import { Injectable } from '@angular/core' ; import { Observable , Subject } from 'rxjs' ; @ Injectable ( ) export class BreadcrumbService { private subject = new Subject < string > ( ) ; onUpdate ( ) { return this . subject . asObservable ( ) ; } updateBreadcrumb ( str ) { this . subject . next ( str ) ; } }