trait Animate extends Object
Animate Service - The $animate service exposes a series of DOM utility methods that provide support for animation hooks.
- Annotations
- @RawJSType() @native()
- See also
- Alphabetic
- By Inheritance
- Animate
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
addClass(element: Element, className: String, options: Object = js.native): Promise[Any]
Triggers an addClass animation surrounding the addition of the provided CSS class(es).
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.
- element
the element which the CSS classes will be applied to
- className
the CSS class(es) that will be added (multiple classes are separated via spaces)
- options
an optional collection of options/styles that will be applied to the element
- returns
the animation callback promise
-
def
animate(element: Element, from: Object, to: Object, className: String, options: Object = js.native): Promise[Any]
Performs an inline animation on the element which applies the provided to and from CSS styles to the element.
Performs an inline animation on the element which applies the provided to and from CSS styles to the element. If any detected CSS transition, keyframe or JavaScript matches the provided className value then the animation will take on the provided styles. For example, if a transition animation is set for the given className then the provided from and to styles will be applied alongside the given transition. If a JavaScript animation is detected then the provided styles will be given in as function paramters into the animate method (or as apart of the options parameter).
- element
the element which the CSS styles will be applied to
- from
the from (starting) CSS styles that will be applied to the element and across the animation.
- to
the to (destination) CSS styles that will be applied to the element and across the animation.
- className
an optional CSS class that will be applied to the element for the duration of the animation. If this value is left as empty then a CSS class of ng-inline-animate will be applied to the element. (Note that if no animation is detected then this value will not be appplied to the element.)
- options
an optional collection of options/styles that will be applied to the element
- returns
the animation callback promise
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
cancel(animationPromise: Promise[Any]): Unit
Cancels the provided animation.
Cancels the provided animation.
- animationPromise
The animation promise that is returned when an animation is started.
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
enabled(element: Element = js.native, enabled: Boolean = js.native): Boolean
Used to get and set whether animations are enabled or not on the entire application or on an element and its children.
Used to get and set whether animations are enabled or not on the entire application or on an element and its children.
- element
the element that will be considered for checking/setting the enabled state
- enabled
whether or not the animations will be enabled for the element
- returns
whether or not animations are enabled
-
def
enter(element: Element, parent: Element, after: Element = js.native, options: Object = js.native): Promise[Any]
Inserts the element into the DOM either after the after element (if provided) or as the first child within the parent element and then triggers an animation.
Inserts the element into the DOM either after the after element (if provided) or as the first child within the parent element and then triggers an animation. A promise is returned that will be resolved during the next digest once the animation has completed.
- element
the element which will be inserted into the DOM
- parent
the parent element which will append the element as a child (so long as the after element is not present)
- after
the sibling element after which the element will be appended
- options
an optional collection of options/styles that will be applied to the element
- returns
the animation callback promise
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
-
def
leave(element: Element, options: Object = js.native): Promise[Any]
Triggers an animation and then removes the element from the DOM.
Triggers an animation and then removes the element from the DOM. When the function is called a promise is returned that will be resolved during the next digest once the animation has completed.
- element
the element which will be removed from the DOM
- options
an optional collection of options/styles that will be applied to the element
- returns
the animation callback promise
-
def
move(element: Element, parent: Element, after: Element, options: Object = js.native): Promise[Any]
Inserts (moves) the element into its new position in the DOM either after the after element (if provided) or as the first child within the parent element and then triggers an animation.
Inserts (moves) the element into its new position in the DOM either after the after element (if provided) or as the first child within the parent element and then triggers an animation. A promise is returned that will be resolved during the next digest once the animation has completed.
- element
the element which will be moved into the new DOM position
- parent
the parent element which will append the element as a child (so long as the after element is not present)
- after
the sibling element after which the element will be appended
- options
an optional collection of options/styles that will be applied to the element
- returns
the animation callback promise
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
off(event: Event, container: Any = js.native, callback: Function = js.native): Unit
Deregisters an event listener based on the event which has been associated with the provided element.
Deregisters an event listener based on the event which has been associated with the provided element. This method can be used in three different ways depending on the arguments:
- event
the animation event (e.g. enter, leave, move, addClass, removeClass, etc...)
- container
the container element the event listener was placed on
- callback
the container element the event listener was placed on
-
def
on(event: Event, container: Any, callback: Function): Unit
Sets up an event listener to fire whenever the animation event (enter, leave, move, etc...) has fired on the given element or among any of its children.
Sets up an event listener to fire whenever the animation event (enter, leave, move, etc...) has fired on the given element or among any of its children. Once the listener is fired, the provided callback is fired with the following params:
- event
the animation event that will be captured (e.g. enter, leave, move, addClass, removeClass, etc...)
- container
the container element that will capture each of the animation events that are fired on itself as well as among its children
- callback
the callback function that will be fired when the listener is triggered The arguments present in the callback function are:
- element - The captured DOM element that the animation was fired on.
- phase - The phase of the animation. The two possible phases are start (when the animation starts) and close (when it ends).
-
def
pin(element: Element, parentElement: Element): Unit
Associates the provided element with a host parent element to allow the element to be animated even if it exists outside of the DOM structure of the Angular application.
Associates the provided element with a host parent element to allow the element to be animated even if it exists outside of the DOM structure of the Angular application. By doing so, any animation triggered via $animate can be issued on the element despite being outside the realm of the application or within another application. Say for example if the application was bootstrapped on an element that is somewhere inside of the <body> tag, but we wanted to allow for an element to be situated as a direct child of document.body, then this can be achieved by pinning the element via $animate.pin(element). Keep in mind that calling $animate.pin(element, parentElement) will not actually insert into the DOM anywhere; it will just create the association.
- element
the external element that will be pinned
- parentElement
the host parent element that will be associated with the external element
-
def
propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
-
def
removeClass(element: Element, className: String, options: Object = js.native): Promise[Any]
Triggers a removeClass animation surrounding the removal of the provided CSS class(es).
Triggers a removeClass animation surrounding the removal of the provided CSS class(es). Upon execution, the removeClass operation will only be handled after the next digest and it will not trigger an animation if element does not contain the CSS class or if the class is added 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.
- element
the element which the CSS classes will be applied to
- className
the CSS class(es) that will be removed (multiple classes are separated via spaces)
- options
an optional collection of options/styles that will be applied to the element
- returns
the animation callback promise
-
def
setClass(element: Element, add: String, remove: String, options: Object = js.native): Promise[Any]
Performs both the addition and removal of a CSS classes on an element and (during the process) triggers an animation surrounding the class addition/removal.
Performs both the addition and removal of a CSS classes on an element and (during the process) triggers an animation surrounding the class addition/removal. Much like $animate.addClass and $animate.removeClass, setClass will only evaluate the classes being added/removed once a digest has passed. 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.
- element
the element which the CSS classes will be applied to
- add
the CSS class(es) that will be added (multiple classes are separated via spaces)
- remove
the CSS class(es) that will be removed (multiple classes are separated via spaces)
- options
an optional collection of options/styles that will be applied to the element
- returns
the animation callback promise
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toLocaleString(): String
- Definition Classes
- Object
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
valueOf(): Any
- Definition Classes
- Object
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )