Slide 17
Slide 17 text
export class PageService {
}
Utilize the built-in
Title & Meta Service
Set page title
Update meta tag
Inject title & meta services
constructor(private title: Title, private meta: Meta) {}
setPageMeta(title: string, metaDesc: string, metaImg: string) {
this.title.setTitle(title);
this.meta.updateTag({ property: 'og:title', content: title });
this.meta.updateTag({ name: 'description', content: metaDesc });
this.meta.updateTag({ name: 'twitter:image', content: metaImg });
...
}