Uncaught ReferenceError: angular is not defined 错误

来源:互联网 发布:linux 网络测速工具 编辑:程序博客网 时间:2024/04/29 10:45

如下代码报错: Uncaught ReferenceError: angular is not defined


<!DOCTYPE html>
<html>
<body>


<div ng-app="myApp" ng-controller="personController">
test


</div>




<script>
var myAppModule = angular.module('myApp',[]);


myAppModule.controller('personController',
function personController($scope) {
   console.log("rose");
})
</script>

<script src="D:\automation\tools\data_desensitization\src\main\webapp\webapps\app\bower_components\angular\angular.min.js"></script>



</body>
</html>

百度得到: The error says, you are attempt to use angular before load the script. 。把angular.min.js引用放在定义模块前就解决了

1 0
原创粉丝点击