以下是使用 google angular js cdn 的演示页面:
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>
</head>
<body ng-controller="TextController">
<p>{{mytext}}</p>
</body>
<script>
function TextController($scope) {
$scope.mytext = "hello world";
}
</script>
</html>
我使用了最新的 google angular js cdn。
它给出了一系列错误,如下所示:
angular.js:13708 Error: [ng:areq] http://errors.angularjs.org/1.5.7/ng/areq?p0=TextController&p1=not%20a%20function%2C%20got%20undefined
at Error (native)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js:6:412
at sb (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js:22:508)
at Qa (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js:23:78)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js:89:273
at ag (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js:72:353)
at m (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js:64:218)
at g (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js:58:481)
at g (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js:58:498)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js:58:119(anonymous function) @ angular.js:13708
但是,当我将 angular 的版本更改为1.0.1
. 页面显示正确。
新版本有变化吗?