shared-service.service.ts 374 Bytes
import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';

@Injectable()
export class SharedServiceService {

  // title = new Subject<string>();
  title = new BehaviorSubject<string>('default');
  title$ = this.title.asObservable();

  constructor() {
  }

  changedTitle(newTitle: string) {
    this.title.next(newTitle);
  }


}