回答

0

問題是,如果我創建的css與animation.css的名稱相同,animation.css總是接管,所以我只是爲我的類添加一個前綴,並修復了問題。

0

只需在樣式表中創建一些動畫類,然後根據您喜歡的vm中的任何變量通過ng-class切換它們。下面可能是你的標記:

<ul> 
    <li ng-repeat="item in vm.items track by item.id" 
     ng-class="{ 
     'animation-1-class': vm.varOfYourChoice, 
     'animation-2-class': !vm.varOfYourChoice 
     }" 
    ></li> 
</ul> 

而且樣式表中:

.animation-1-class.ng-enter, 
.animation-1-class.ng-leave.ng-leave-active { ... } 

.animation-1-class.ng-leave, 
.animation-1-class.ng-enter.ng-enter-active { ... } 

.animation-2-class.ng-enter, 
.animation-2-class.ng-leave.ng-leave-active { ... } 

.animation-2-class.ng-leave, 
.animation-2-class.ng-enter.ng-enter-active { ... } 

而且here是對你使用AngularJs版本角動畫相關文件。