Creating enter animations with ngIf
AngularJS provides hooks to define a custom animation when a directive fires an enter event. The following directives will generate enter events:
ngIf: This fires theenterevent just after thengIfcontents change, and a new DOM element is created and injected into thengIfcontainerngInclude: This fires theenterevent when new content needs to be brought into the browserngRepeat: This fires theenterevent when a new item is added to the list or when an item is revealed after a filterngSwitch: This fires theenterevent after thengSwitchcontents change, and the matched child element is placed inside the containerngView: This fires theenterevent when new content needs to be brought into the browserngMessage: This fires theenterevent when an inner message is attached
Getting ready
Suppose that you want to attach a fade-in animation to a piece of the DOM that has a ng-if directive attached to it. When the ng-if expression evaluates to true, the enter...