是否有任何npm模块/其他方式(如React-Helmet)允许我们在通过Angular 应用程序时更改页面标题?
PS:我用的是Angular 5.
是否有任何npm模块/其他方式(如React-Helmet)允许我们在通过Angular 应用程序时更改页面标题?
PS:我用的是Angular 5.
你在Angular 5有一个标题服务.将其注入组件的构造函数中,并使用setTitle()
方法.
import {Title} from "@angular/platform-browser";
....
constructor(private titleService:Title) {
this.titleService.setTitle("Some title");
}
这是来自Angular:https://angular.io/guide/set-document-title的文件