4

キャッチされないエラー: [$injector:unpr] 不明なプロバイダー: $animateProvider <- $animate

このリンクにあるように、Angular-ui を使用してカルーセルを作成しようとしています。 http://angular-ui.github.io/bootstrap/

しかし、私はそのエラーが発生します。

詳細: .min angular スクリプト ファイルを使用しています。index.html には、リンクに示されているのと同じコードがあります。この投稿Error: Unknown provider: employeesProvider <- employeesによると、html から ng-controller を取得し、angular-seed アプリで指定されているように controller.js でコントローラーをバインドしています。

また、http://docs.angularjs.org/error/ $injector:unpr?p0=$animateProvider%20%3C-%20$animate は役に立ちませんでした。

その理由は何ですか?

4

3 に答える 3

0

私もあなたと同じ問題に遭遇し、バージョン angular-1.4.3 を使用して解決しました。これが私の解決のプロセスです。デモを実行しようとすると、ネットワークデモアドレスからディレクティブ「nginclude」を実行しようとしていますが、Firefoxコンソールにエラーが表示されますが、バージョンをAngularの1.4.3に変更すると、すべて解決しました。ちなみに、バージョンは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>

ありがとうございました。

于 2015-07-17T07:26:38.877 に答える
0

このエラーは、Chrome の Batarang への自動更新が原因で発生することもあります。古いバージョンの Angular を使用している私のサイトで、突然このエラー (不明なプロバイダー: $animateProvider <- $animate) が発生し始め、再び機能させるために Batarang を無効にする必要がありました。

于 2014-12-10T19:49:03.493 に答える