import { OnDestroy , AfterViewInit } from '@angular/core' ; import { AnimationsService } from './index' ; export abstract class Animations implements OnDestroy , AfterViewInit { public activateAnimation = true ; param { AnimationsService } animationsService public constructor ( protected animationsService ) { } see https public ngOnDestroy ( ) { this . animationsService . announceMission ( true ) ; } see https public ngAfterViewInit ( ) { this . animationsService . announceMission ( false ) ; } }