2017-07-07 63 views
4

我正在研究AngularJS應用程序,並且嘗試添加Angular Animate。Uncaught TypeError:a.customFilter不是ngAnimate函數

Angular Route沒有引起任何問題,但它似乎Angular Animate與我的應用程序中的某些東西不兼容。

我加載庫順序如下:

<script type="text/javascript" src="../node_modules/jquery/dist/jquery.min.js"></script> 
<script type="text/javascript" src="../node_modules/angular/angular.min.js"></script> 
<script type="text/javascript" src="../node_modules/angular-animate/angular-animate.min.js"></script> 
<script type="text/javascript" src="../node_modules/angular-route/angular-route.min.js"></script> 

而且在使用它們我app.js

var app = angular.module('tictactoe', ['ngRoute', 'ngAnimate']); 

,我發現了以下錯誤。 jQuery和角(香草+幹線+動畫),已安裝了NPM

My error

依賴版本:

versions

+0

什麼版本的包呢? –

+0

@NikolajDamLarsen答案已經與軟件包版本更新:) – Zooly

回答

4

使用角度版本1.6.5或降級角動畫版1.6.4它會解決問題。 下面是一些角應用實例,其中該依賴條件可以驗證(只是改變CDN鏈接庫的版本)的普拉克

https://plnkr.co/edit/v0cLmZvYAC8m1J7JdwHf?p=preview

+0

是的,它似乎是一個角度兼容版本問題,謝謝! – Zooly

+0

@Zooly歡迎:) – Shantanu

+0

這有幫助。我使用了'from the plunker code attached :) – Chip

0

請降級到版本角動畫1.6.4。 這裏是你也應該從該鏈接下載的文件。這個對我有用。

https://code.angularjs.org/1.6.4/ 

而且改變bower.json(角動畫/ bower.json) enter image description here

+0

嗨歐麥爾! Shantanu已經解決了這個問題。無論如何,感謝您的幫助。 – Zooly

+0

沒問題。我只是提出一個解決方案。因爲它適合我。 –

相關問題