Reputation: 159
Seems to be simple, but I can't find the easy solution. I'm using Title service to put title at document. This is working fine, see the documentation here: https://angular.io/guide/set-document-title
My problem is with the especial characters. In my code the title is set by routing service, but my pages titles have special characters. Take the example: page title "Início", the í character do not format properly.
There's some function or service to do this in Angular?
My code, the problem is in setTitle:
AssinarEventosRoute(): any {
this.router.events
.filter((event) => event instanceof NavigationEnd)
.map(() => this.activatedRoute)
.map((route) => {
while (route.firstChild) route = route.firstChild;
return route;
})
.filter((route) => route.outlet === 'primary')
.mergeMap((route) => route.data)
.subscribe((event) => this.titleService.setTitle(`${event['title']} | Gerencial ISP 2`));
}
Upvotes: 2
Views: 1019
Reputation: 4174
You have to add a charset tag in your HTML file:
<meta charset="utf-8">
Also, your .ts files should be encoded in UTF-8 as well.
Angular template view with utf-8 chars doesn't work
Upvotes: 3