| | |
| | | import { Component, HostBinding, OnInit } from '@angular/core'; |
| | | import { Router, NavigationEnd, NavigationStart } from '@angular/router'; |
| | | import { ThemesService, SettingsService, TitleService } from '@delon/theme'; |
| | | import { filter, map } from 'rxjs/operators'; |
| | | import { filter } from 'rxjs/operators'; |
| | | import * as $ from 'jquery'; |
| | | @Component({ |
| | | selector: 'app-root', |
| | |
| | | } |
| | | |
| | | ngOnInit() { |
| | | this.router.events.pipe( |
| | | filter(evt => evt instanceof NavigationEnd), |
| | | map(() => this.router.url) |
| | | ) |
| | | .subscribe(url => { |
| | | this.titleSrv.setTitleByUrl(url); |
| | | }); |
| | | this.router.events |
| | | .pipe(filter(evt => evt instanceof NavigationEnd)) |
| | | .subscribe(() => this.titleSrv.setTitle()); |
| | | this.router.events.pipe( |
| | | filter(evt => evt instanceof NavigationStart) |
| | | ) |