gpt4 book ai didi

javascript - AngularJS 不显示值

转载 作者:行者123 更新时间:2023-12-01 02:54:40 24 4
gpt4 key购买 nike

我读到This文章,但仍然有疑问,因为我是 AngularJS 的新手。我创建 Web 应用程序并通过 Nuget Manager 添加 AngularJS Core。

我尝试一下代码

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>First Page</title>
<script src="~/Scripts/angular.js"></script>
</head>
<body ng-app>
{{2+2}}
</body>
</html>

所以,我希望我的网页显示 4,但它仍然显示表达式。

请帮忙。

最佳答案

检查您的脚本是否正在加载 angular.js。

演示

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>First Page</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
</head>
<body ng-app>
{{2+2}}
</body>
</html>

关于javascript - AngularJS 不显示值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46786690/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com