2013-12-10 21 views
3

當我有一個非常類似如下的列表:ngRepeat瘋狂的行爲加上ngAnimate

<ul> 
    <li ng-repeat="acc in get_acc()"> 
    {{acc.value}} 
    </li> 
</ul> 

,然後是假設打印!

acc-1 
acc-2 
acc-3 

So..I添加角animate.js到我的項目和chnaged角版本1.2.4來也。 添加ngAnimate作爲我的項目的依賴項!

並在其他地方使用ng-enter等!

這件事情發瘋了!

突然之間的名單看起來像這樣!

acc-1 
acc-2 
acc-3 
acc-2 
acc-1 
acc-3 
........ 

所有可能的排列!

並在我有控制檯。

Error: [$rootScope:infdig] http://errors.angularjs.org/1.2.4/$rootScope/infdig?p0=10&p1=%5B%5B%22fn%3A…%20newVal%3A%20%5C%22acc-1%5C%22%3B%20oldVal%3A%20undefined%22%5D%5D 
    at Error (<anonymous>) 
    at http://localhost:3000/angular/angular.min.js:6:449 
    at h.$digest (http://localhost:3000/angular/angular.min.js:100:188) 
    at h.$delegate.__proto__.$digest (<anonymous>:844:31) 
    at h.$apply (http://localhost:3000/angular/angular.min.js:102:100) 
    at h.$delegate.__proto__.$apply (<anonymous>:855:30) 
    at http://localhost:3000/angular/angular.min.js:17:415 
    at Object.d [as invoke] (http://localhost:3000/angular/angular.min.js:30:352) 
    at Xb.c (http://localhost:3000/angular/angular.min.js:17:323) 
    at Xb (http://localhost:3000/angular/angular.min.js:18:30) angular.min.js:84 
(anonymous function) 

任何想法發生了什麼? 角度文檔在基礎知識方面已經很糟糕,現在這些東西沒有任何解釋!

+0

如果你可以在plunkr或jsfiddle中重現這種行爲,它會更容易幫助你。 – dtabuenc

回答

2

這是Angular的一個bug,你可以在這個link找到詳細的解釋和討論。

+0

我應該回到prev版本,我不需要ngAnimate作爲單獨的依賴項嗎? 我需要ng-show的snimations ..現在它搞亂了我的ng-repeat! –