我读到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/