Help Angular by taking a 1 minute survey!Go to surveyHome

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)
      
      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
      
      onStart(fn: () => void): void
    
Parameters
fn () => void
Returns

void

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

void

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

void

hasStarted(): boolean
      
      hasStarted(): boolean
    
Parameters

There are no parameters.

Returns

boolean

init(): void
      
      init(): void
    
Parameters

There are no parameters.

Returns

void

play(): void
      
      play(): void
    
Parameters

There are no parameters.

Returns

void

pause(): void
      
      pause(): void
    
Parameters

There are no parameters.

Returns

void

restart(): void
      
      restart(): void
    
Parameters

There are no parameters.

Returns

void

finish(): void
      
      finish(): void
    
Parameters

There are no parameters.

Returns

void

destroy(): void
      
      destroy(): void
    
Parameters

There are no parameters.

Returns

void

reset(): void
      
      reset(): void
    
Parameters

There are no parameters.

Returns

void

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

void

getPosition(): number
      
      getPosition(): number
    
Parameters

There are no parameters.

Returns

number