From b4f60bc9c5f2f74eee61c2fc2a639618aaf52c2b Mon Sep 17 00:00:00 2001 From: fengxiang <110431245@qq.com> Date: Tue, 27 Feb 2018 16:57:03 +0800 Subject: [PATCH] 更新主题系统版本 --- src/app/app.component.ts | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index efcceed..90c68af 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -3,7 +3,7 @@ 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', @@ -24,13 +24,9 @@ } 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) ) -- Gitblit v1.8.0