Creating leave and concurrent animations with ngView
AngularJS provides hooks used to define a custom animation when a directive fires a leave
event. The following directives will generate leave
events:
ngIf
: This fires theleave
event just before thengIf
contents are removed from the DOMngInclude
: This fires theleave
event when the existing included content needs to be animated awayngRepeat
: This fires theleave
event when an item is removed from the list or when an item is filtered outngSwitch
: This fires theleave
event just after thengSwitch
contents change and just before the former contents are removed from the DOMngView
: This fires theleave
event when the existingngView
content needs to be animated awayngMessage
: This fires theleave
event when an inner message is removed
Getting ready
Suppose that you want to attach a slide-in or slide-out animation to a piece of the DOM that exists inside the ng-view
directive. Route changes that cause the content of ng-view
to be altered will...