Issue
Is there any npm module/ other way like React-Helmet that allows us to change page title as we route through our Angular application?
PS: I am using Angular 5.
Solution
You have a TitleService in Angular 5. Inject it in your component's constructor, and use the setTitle()
method.
import {Title} from "@angular/platform-browser";
....
constructor(private titleService:Title) {
this.titleService.setTitle("Some title");
}
Here are the docs from Angular: https://angular.io/guide/set-document-title
Answered By - John
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.