src/app/core/animations/animations.service.ts
constructor()
|
Static isRouteAnimationsType |
isRouteAnimationsType(type: RouteAnimationType)
|
Returns:
void
|
updateRouteAnimationType |
updateRouteAnimationType(pageAnimations: boolean, elementsAnimations: boolean)
|
Returns:
void
|
Private 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';