Set angular 2 dynamic page title

Create a title service class name like title.service.ts and put below code. import { Injectable } from ‘@angular/core’; import ‘rxjs/add/operator/filter’; import ‘rxjs/add/operator/map’; import ‘rxjs/add/operator/mergeMap’; import { Router, NavigationEnd, ActivatedRoute } from ‘@angular/router’; import { Title } from ‘@angular/platform-browser’; const APP_TITLE = ‘My App’; const SEPARATOR = ‘ | ‘; @Injectable() export class TitleService { constructor(