import {Injectable} from '@angular/core'; import {BehaviorSubject} from 'rxjs'; @Injectable() export class VersionService { public version: BehaviorSubject; constructor() { this.version = new BehaviorSubject(null); } public onNewVersion(version: string) { if (this.version.value === version) { return; } this.version.next(version); } }