Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 将ngAnimate包含为从属模块时出错_Javascript_Angularjs_Ng Animate - Fatal编程技术网

Javascript 将ngAnimate包含为从属模块时出错

Javascript 将ngAnimate包含为从属模块时出错,javascript,angularjs,ng-animate,Javascript,Angularjs,Ng Animate,尝试将ngAnimate添加为依赖模块时出错。我知道这不是一个好问题,但我希望有人能帮我找出为什么我会出错 使用JSFIDLE时,它可以正常工作: 但在我的浏览器中运行时会出现错误。当我将ngAnimate作为一个依赖模块删除时,一切都很好,所以我知道这就是问题所在 HTML: <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/ang

尝试将
ngAnimate
添加为依赖模块时出错。我知道这不是一个好问题,但我希望有人能帮我找出为什么我会出错

使用JSFIDLE时,它可以正常工作:

但在我的浏览器中运行时会出现错误。当我将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>
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的URL。cloudfar CDN url在JSFIDLE中工作,所以我不确定这是否是问题所在。您在
scr中也有输入错误,而不是在src中