//this top animation is what I have seen and was hoping to find a way to do with enter-leave below
app.animation('.answer-animation', function(){
return {
beforeAddClass: function(element, className, done){
if (className == 'answer') {
console.log('stuff todo beforeAddClass');
}
else {
done();
}
},
beforeRemoveClass: function(element, className, done) {
if (className == 'answer') {
console.log('stuff todo beforeRemoveClass');
}
else {
done();
}
}
};
/*what I am trying to do below*/
app.animation(".viewAnimation", function ($anchorScroll, $timeout) {
return {
//***********would like to do something before enter
enter: function(element, done) {
},
leave: function(element, done) {
}
};
});
嗨,我正在寻找一种方法来挂钩角度生命周期,类似于可用于ng-hide的beforeAddClass。对于我的,我有一个视图动画,在进入之前,我想做点什么。在“输入”执行之前,我没有找到或者无论如何都可以执行某些操作。我该怎么做呢?