如下代码 <!DOCTYPE html>
<html ng-app="myApp">
<body>
<div ng-controllers="personController">
test
</div>
<script type="text/javascript" src="D:\automation\tools\data_desensitization\src\main\webapp\webapps\app\bower_components\angular\angular.min.js"></script>
<script type="text/javascript">
angular.module('myApp',[]).controller('personController',
function personController($scope) {
console.log("rose");}
)
</script>
</body>
</html> 在控制台实在打印不出rose.纠结对比半天,原来<div ng-controllers="personController">应写成<div ng-controller="personController">。也许不应该用notepad++ 写angularJS
<html ng-app="myApp">
<body>
<div ng-controllers="personController">
test
</div>
<script type="text/javascript" src="D:\automation\tools\data_desensitization\src\main\webapp\webapps\app\bower_components\angular\angular.min.js"></script>
<script type="text/javascript">
angular.module('myApp',[]).controller('personController',
function personController($scope) {
console.log("rose");}
)
</script>
</body>
</html> 在控制台实在打印不出rose.纠结对比半天,原来<div ng-controllers="personController">应写成<div ng-controller="personController">。也许不应该用notepad++ 写angularJS