You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
573 B
19 lines
573 B
import { Injectable } from "@angular/core";
|
|
import { Title } from "@angular/platform-browser";
|
|
import { RouterStateSnapshot, TitleStrategy } from "@angular/router";
|
|
|
|
@Injectable({ providedIn: "root" })
|
|
export class TemplatePageTitleStrategy extends TitleStrategy {
|
|
constructor(private readonly title: Title) {
|
|
super();
|
|
}
|
|
|
|
override updateTitle(routerState: RouterStateSnapshot) {
|
|
const title = this.buildTitle(routerState);
|
|
let fullTitle = "营养配餐系统";
|
|
if (title !== undefined) {
|
|
fullTitle += ` | ${title}`;
|
|
}
|
|
this.title.setTitle(fullTitle);
|
|
}
|
|
}
|
|
|