Help me understand how to use "doneFn" in angular 1.4+

Hi,

I’m trying to create enter and leave animations with TweenMax and angular 1.4+.

I have this code:

.animation(‘.page’, [function(){

return {
  enter: function(element, doneFn){
    TweenMax.from(element, 1, { css: { transform: "scale(0.8)", opacity: 0 }, force3D: "auto" });
  },
  leave: function(element, doneFn){
    TweenMax.to(element, 1, { css: { transform: "scale(1.1)", opacity: 0 }, force3D: "auto" });
  }
};

}])

The animations is working but the thing is the pages get stacked, since I don’t tell angular when the animation is done. You are supposed to use “doneFn” for this but I don’t know how to implement that in the code.

I suspect doneFn represents a callback function that you must write.
It will be called when the animation is complete (if you reference it as the onComplete parameter).

1 Like

Yes correct, worked with onComplete: doneFn =)

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.