将 ngAnimate 包含为依赖模块时出错
Error including ngAnimate as a dependent module
当我尝试将 ngAnimate
添加为依赖模块时出现错误。我知道这不是一个好问题,但我希望有人能帮我弄清楚为什么我会出错。
使用 JSFiddle 时工作正常:https://jsfiddle.net/m2jwb77h/3/
但是我在浏览器中 运行 时收到错误。当我删除 ngAnimate
作为依赖模块时,一切都很好,所以我知道这就是问题所在。
HTML:
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script scr="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.8/angular-animate.js"></script>
<script src="ngAnimateTest.js"></script>
</head>
<body ng-app="myApp" ng-controller="myController">
{{test}}
</body>
</html>
JS:
var app = angular.module("myApp", ["ngAnimate"]);
app.controller("myController", ["$scope", function($scope) {
$scope.test = "It works!"
}]);
cloudflare CDN 出了点问题。
尝试将此 url 用于 ngAnimate
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
Upd: 错字是 scr 而不是 src
当我尝试将 ngAnimate
添加为依赖模块时出现错误。我知道这不是一个好问题,但我希望有人能帮我弄清楚为什么我会出错。
使用 JSFiddle 时工作正常:https://jsfiddle.net/m2jwb77h/3/
但是我在浏览器中 运行 时收到错误。当我删除 ngAnimate
作为依赖模块时,一切都很好,所以我知道这就是问题所在。
HTML:
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script scr="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.8/angular-animate.js"></script>
<script src="ngAnimateTest.js"></script>
</head>
<body ng-app="myApp" ng-controller="myController">
{{test}}
</body>
</html>
JS:
var app = angular.module("myApp", ["ngAnimate"]);
app.controller("myController", ["$scope", function($scope) {
$scope.test = "It works!"
}]);
cloudflare CDN 出了点问题。 尝试将此 url 用于 ngAnimate
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
Upd: 错字是 scr 而不是 src