Creating removeClass animations with ngClass
AngularJS provides hooks that can be used to define a custom animation when a directive fires a removeClass
event. The following directives will generate removeClass
events:
ngShow
: This fires theremoveClass
event after thengShow
expression evaluates to a non-truthy value, and just before the contents are set to hiddenngHide
: This fires theremoveClass
event after thengHide
expression evaluates to a truthy value, and just before the contents are set to hiddenngClass
: This fires theremoveClass
event just before the class is removed from the elementngForm
: This fires theremoveClass
event to remove validation classesngModel
: This fires theremoveClass
event to remove validation classesngMessages
: This fires theremoveClass
event to remove theng-active
class when there are no messages, or to remove theng-inactive
class when one or more messages are visible
Getting ready
Suppose that you want to have a div
element slide out of the view when a class...