【发布时间】:2022-06-14 22:59:46
【问题描述】:
我想用后端的标题更改我的 Angular 应用程序的页面标题。我使用了 angular Title 服务,但这并没有解决问题, 到目前为止,这是我在应用程序组件中的代码:
ngOnInit(): void {
this.page = this.visuals.pageTitle;
this.visualsService.getVisuals().subscribe((res: any) => {
this.visuals = res;
this.title.setTitle(this.visuals.pageTitle);
});
}
还有其他解决办法吗?
【问题讨论】:
-
订阅执行了吗?
标签: angular page-title