Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
Say hello to Angular's future home!Check out Angular.devHome
/

NoopAnimationPlayer

An empty programmatic controller for reusable animations. Used internally when animations are disabled, to avoid checking for the null case when an animation player is expected.

      
      class NoopAnimationPlayer implements AnimationPlayer {
  constructor(duration: number = 0, delay: number = 0)
  parentPlayer: AnimationPlayer | null
  totalTime: number
  onStart(fn: () => void): void
  onDone(fn: () => void): void
  onDestroy(fn: () => void): void
  hasStarted(): boolean
  init(): void
  play(): void
  pause(): void
  restart(): void
  finish(): void
  destroy(): void
  reset(): void
  setPosition(position: number): void
  getPosition(): number
}
    

Subclasses

See also

Constructor

      
      constructor(duration: number = 0, delay: number = 0)
    
Parameters
duration number

Optional. Default is 0.

delay number

Optional. Default is 0.

Properties

Property Description
parentPlayer: AnimationPlayer | null
totalTime: number Read-Only

Methods

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

void

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

void

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

void

      
      hasStarted(): boolean
    
Parameters

There are no parameters.

Returns

boolean

      
      init(): void
    
Parameters

There are no parameters.

Returns

void

      
      play(): void
    
Parameters

There are no parameters.

Returns

void

      
      pause(): void
    
Parameters

There are no parameters.

Returns

void

      
      restart(): void
    
Parameters

There are no parameters.

Returns

void

      
      finish(): void
    
Parameters

There are no parameters.

Returns

void

      
      destroy(): void
    
Parameters

There are no parameters.

Returns

void

      
      reset(): void
    
Parameters

There are no parameters.

Returns

void

      
      setPosition(position: number): void
    
Parameters
position number
Returns

void

      
      getPosition(): number
    
Parameters

There are no parameters.

Returns

number