File

src/app/core/animations/animations.service.ts

Constructor

constructor()

Methods

Static isRouteAnimationsType
isRouteAnimationsType(type: RouteAnimationType)
Returns: void
updateRouteAnimationType
updateRouteAnimationType(pageAnimations: boolean, elementsAnimations: boolean)
Returns: void

Properties

Private routeAnimationType
routeAnimationType: RouteAnimationType
Default value: ALL
import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class AnimationsService {
  constructor() {
    AnimationsService.routeAnimationType = 'ALL';
  }

  private static routeAnimationType: RouteAnimationType = 'ALL';

  static isRouteAnimationsType(type: RouteAnimationType) {
    return AnimationsService.routeAnimationType === type;
  }

  updateRouteAnimationType(
    pageAnimations: boolean,
    elementsAnimations: boolean
  ) {
    AnimationsService.routeAnimationType =
      pageAnimations && elementsAnimations
        ? 'ALL'
        : pageAnimations
        ? 'PAGE'
        : elementsAnimations
        ? 'ELEMENTS'
        : 'NONE';
  }
}

export type RouteAnimationType = 'ALL' | 'PAGE' | 'ELEMENTS' | 'NONE';

results matching ""

    No results matching ""