【发布时间】:2013-10-11 10:31:54
【问题描述】:
我正在尝试通过使用 add 和 remove 的常用语法将 js 定义的动画附加到 ng-class 指令,但动画不会运行。日志显示 add 和 remove 函数没有被调用。
app.animation( ".bob", function () {
return {
add : function ( element, done ) {
// Do add animation here and call done when done.
},
remove : function ( element, done ) {
// Do remove animation here and call done when done.
}
}
} );
这通常适用于其他指令,如 ngIf 的进入和离开动画,但对于 ngClass,它似乎只适用于 css-animations,正如 the example in the documentation 所证明的那样
【问题讨论】:
标签: javascript angularjs animation ng-animate ng-class