Error including ngAnimate as a dependent module

I get an error when I try to add ngAnimateas a dependent module. I know this is not a big question, but I hope someone helps me understand why I get an error message.

It works fine when using JSFiddle: https://jsfiddle.net/m2jwb77h/3/

But I get an error message when starting in my browser. When I delete ngAnimateas a dependent module, everything is fine, so I know where the problem is.

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!"

}]);
+4
source share
1 answer

Something is wrong with cloud CDN. Try using this url for ngAnimate

    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>

: scr src

+1

Source: https://habr.com/ru/post/1621673/


All Articles