Skip to content

Commit

Permalink
fix(module:theme:title): fix default property should be not read-only (
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk authored Nov 25, 2018
1 parent 96f8adc commit a882507
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/theme/src/services/title/title.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export class TitleService implements OnDestroy {
private _suffix = '';
private _separator = ' - ';
private _reverse = false;
private _default = 'Not Page Name';
private i18n$: Subscription;

constructor(
Expand All @@ -35,8 +34,9 @@ export class TitleService implements OnDestroy {
private i18nSrv: AlainI18NService,
@Inject(DOCUMENT) private doc: any,
) {
if (this.i18nSrv)
if (this.i18nSrv) {
this.i18n$ = this.i18nSrv.change.subscribe(() => this.setTitle());
}
}

/** 设置分隔符 */
Expand All @@ -60,9 +60,7 @@ export class TitleService implements OnDestroy {
}

/** 设置默认标题名 */
set default(value: string) {
this._default = value;
}
default = `Not Page Name`;

private getByElement(): string {
const el =
Expand Down Expand Up @@ -102,7 +100,7 @@ export class TitleService implements OnDestroy {
this.getByRoute() ||
this.getByMenu() ||
this.getByElement() ||
this._default;
this.default;
}
if (title && !Array.isArray(title)) {
title = [title];
Expand Down

0 comments on commit a882507

Please sign in to comment.