This is the archived documentation for Angular v5. Please visit angular.io to see documentation for the current version of Angular.

AnimationPlayer

npm Package @angular/animations
Module import { AnimationPlayer } from '@angular/animations';
Source animations/src/players/animation_player.ts

Interface Overview

      
      interface AnimationPlayer { 
  onDone(fn: () => void): void
  onStart(fn: () => void): void
  onDestroy(fn: () => void): void
  init(): void
  hasStarted(): boolean
  play(): void
  pause(): void
  restart(): void
  finish(): void
  destroy(): void
  reset(): void
  setPosition(p: any): void
  getPosition(): number
  parentPlayer: AnimationPlayer | null
  get totalTime: number
  beforeDestroy?: () => any
  triggerCallback?: (phaseName: string) => void
}
    

Description

AnimationPlayer controls an animation sequence that was produced from a programmatic animation. (see AnimationBuilder for more information on how to create programmatic animations.)

Class Implementations

Members

      
      onDone(fn: () => void): void
    

      
      onStart(fn: () => void): void
    

      
      onDestroy(fn: () => void): void
    

      
      init(): void
    

      
      hasStarted(): boolean
    

      
      play(): void
    

      
      pause(): void
    

      
      restart(): void
    

      
      finish(): void
    

      
      destroy(): void
    

      
      reset(): void
    

      
      setPosition(p: any): void
    

      
      getPosition(): number
    

      
      parentPlayer: AnimationPlayer | null
    

      
      get totalTime: number
    

      
      beforeDestroy?: () => any
    

      
      triggerCallback?: (phaseName: string) => void