AngularJS error: Unknown provider: $ animateProvider <- $ animate

Unprepared error: [$ injector: unpr] Unknown provider: $ animateProvider <- $ animate

I am trying to create a carousel using Angular -ui, as indicated in this link. http://angular-ui.imtqy.com/bootstrap/

But I get this error.

Details: I am using the .min angular script file. Index.html has the same code as in the link. According to this post Error: Unknown provider: employees Provider <- employees , I took the ng controller from html and I bind the controller to the .js controller as indicated in the Angular application.

Also, http://docs.angularjs.org/error/ $ injector: unpr? p0 = $ animateProvider% 20% 3C-% 20 $ animate did not help me.

What could be the reason?

+4
source share
3 answers

I also had problems with the Unknown provider when I introduced ngAnimate to a project with an older version of Angular. It is best to use a version of ngAnimate equal to the current version of Angular in your project. They seem to be released in tandem.

+7
source

- Batarang Chrome. , Angular, ( : $animateProvider < - $animate), Batarang, .

0

, , angular -1.4.3, . "nginclude" , , firefox , 1.4.3 angular, .  , 1.4.3

.js
var APP = angular.module('app', ['ngAnimate'])
APP.controller('ctrl', ['$scope', function($scope) {
$scope.templates =
  [{name: 'template1.html',url:'template1.html'},
    {name: 'template2.html',url:'template2.html'}];
$scope.template = $scope.templates[0];}]);
.html
<!DOCTYPE html>
<html ng-app="app">
<head>
<meta Content-Type="html/text;charset=UTF-8">
<link rel="stylesheet" type="text/css" href="css/animation.css">
<title>ngInclude demo</title>
</head>
<body>
<div ng-controller="ctrl">
  <select ng-model="template" ng-options="t.name for t in templates">
     <option value="">(blank)</option>
  </select>
     url of the template: <code>{{template.url}}</code>
  <hr/>
  <div class="slide-animate-container">
  <div class="slide-animate" ng-include="template.url"></div>
 </div>
 </div>
 </body>
<script src="js/angular.js"></script>
<script src="js/ngInclude.js"></script>
<script src="js/angular-animate.js"></script>
</html>

.

0

All Articles