这是我的 html 文件。 angular.js 文件在 java/main/webapp/js 文件夹下,当我点击它时 Intellij 可以看到它,但是代码不起作用!我在屏幕上打印了 {{helloMessage}} 而不是“hello world”
我在这里错过了什么?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Angular test </title>
</head>
<body>
<h1 ng-controller="HelloWorldCtrl">{{helloMessage}}</h1>
Angular test
<script src="js/angular.js"> </script>
<script type="text/javascript">
function HelloWorldCtrl($scope){
$scope.helloMessage="Hello World";
}
</script >
</body>
</html>
最佳答案
关于javascript - Angular js 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17923859/