Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save samvloeberghs/f25300c860e4aac029c09b5ad953ed5c to your computer and use it in GitHub Desktop.
Save samvloeberghs/f25300c860e4aac029c09b5ad953ed5c to your computer and use it in GitHub Desktop.
meta tags angular
private setTitle(title: string) {
let fullTitle = this.config.seo.title;
if (title && title.length) {
fullTitle = `${title} - ` + this.config.seo.title;
}
this.titleService.setTitle(fullTitle);
if (this.isNode) {
this.metaService.addTags([
{name: 'twitter:title', content: fullTitle},
{name: 'twitter:image:alt', content: fullTitle},
{property: 'og:title', content: fullTitle},
]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment