import { Injectable } from '@angular/core' ; import { Subject } from 'rxjs/Subject' ; @ Injectable ( ) export class AnimationsService { private activateAnimation = new Subject < boolean > ( ) ; public activateAnimation$ = this . activateAnimation . asObservable ( ) ; announceMission ( value ) { if ( ! value ) { setTimeout ( ( ) => { this . activateAnimation . next ( value ) ; } , 0 ) ; } else { this . activateAnimation . next ( value ) ; } } }