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

MockAnimationPlayer

class MockAnimationPlayer extends NoopAnimationPlayer { constructor(element: any, keyframes: {...}, duration: number, delay: number, easing: string, previousPlayers: any[]) previousStyles: {...} currentSnapshot: ɵStyleData element: any keyframes: {...} duration: number delay: number easing: string previousPlayers: any[] onInit(fn: () => any) init() finish(): void destroy(): void triggerMicrotask() play(): void hasStarted() beforeDestroy() // inherited from animations/NoopAnimationPlayer 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 }
      
      class MockAnimationPlayer extends NoopAnimationPlayer {
  constructor(element: any, keyframes: {...}, duration: number, delay: number, easing: string, previousPlayers: any[])
  previousStyles: {...}
  currentSnapshot: ɵStyleData
  element: any
  keyframes: {...}
  duration: number
  delay: number
  easing: string
  previousPlayers: any[]
  onInit(fn: () => any)
  init()
  finish(): void
  destroy(): void
  triggerMicrotask()
  play(): void
  hasStarted()
  beforeDestroy()

  // inherited from animations/NoopAnimationPlayer
  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
}
    

Constructor

constructor(element: any, keyframes: { [key: string]: string | number; }[], duration: number, delay: number, easing: string, previousPlayers: any[])
      
      constructor(element: any, keyframes: {
    [key: string]: string | number;
}[], duration: number, delay: number, easing: string, previousPlayers: any[])
    

Parameters

element

Type: any.

keyframes

Type: { [key: string]: string | number; }[].

duration

Type: number.

delay

Type: number.

easing

Type: string.

previousPlayers

Type: any[].

Properties

Property Description
previousStyles: { [key: string]: string | number; }
currentSnapshot: ɵStyleData
element: any Declared in constructor.
keyframes: { [key: string]: string | number; }[] Declared in constructor.
duration: number Declared in constructor.
delay: number Declared in constructor.
easing: string Declared in constructor.
previousPlayers: any[] Declared in constructor.

Methods

onInit(fn: () => any)
      
      onInit(fn: () => any)
    

Parameters

fn

Type: () => any.

init()
      
      init()
    

Parameters

There are no parameters.

finish(): void
      
      finish(): void
    

Parameters

There are no parameters.

Returns

void

destroy(): void
      
      destroy(): void
    

Parameters

There are no parameters.

Returns

void

triggerMicrotask()
      
      triggerMicrotask()
    

Parameters

There are no parameters.

play(): void
      
      play(): void
    

Parameters

There are no parameters.

Returns

void

hasStarted()
      
      hasStarted()
    

Parameters

There are no parameters.

      
      beforeDestroy()
    

Parameters

There are no parameters.