如下代码报错: 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引用放在定义模块前就解决了