//trying to replicate the top animation with the enter-leave animation below
app.animation('.answer-animation', function(){
return {
beforeAddClass: function(element, className, done){
if (className == 'answer') {
console.log('perform actions before adding class');
}
else {
done();
}
},
beforeRemoveClass: function(element, className, done) {
if (className == 'answer') {
console.log('perform actions before removing class');
}
else {
done();
}
}
};
/*attempting to create a similar animation below*/
app.animation(".viewAnimation", function ($anchorScroll, $timeout) {
return {
//***********would like to do something before enter
enter: function(element, done) {
},
leave: function(element, done) {
}
};
});
Hello, I am in search of a method to intercept the angular lifecycle, akin to beforeAddClass for ng-hide. In my case, I have a view animation where I would like to execute some actions before entering. Unfortunately, there doesn't seem to be a beforeEnter option available or a way to perform actions before "enter" is triggered. Any suggestions on how I can achieve this?