$animate.addClass()

addClass(element, className, [options]);

Triggers an addClass animation surrounding the addition of the provided CSS class(es). Upon execution, the addClass operation will only be handled after the next digest and it will not trigger an animation if element already contains the CSS class or if the class is removed at a later step. Note that class-based animations are treated differently compared to structural animations (like enter, move and leave) since the CSS classes may be added/removed at different points depending if CSS or JavaScript animations are used.

Parameters

Param Type Details
element DOMElement

the element which the CSS classes will be applied to

className string

the CSS class(es) that will be added (multiple classes are separated via spaces)

options
(optional)
object

an optional collection of options/styles that will be applied to the element

Returns

Promise

the animation callback promise

doc_AngularJS
2016-03-29 16:10:04
Comments
Leave a Comment

Please login to continue.