SeoService

A flexible solution for setting title and meta tags

Instance

static get Instance(): SeoService { return this.instance || (this.instance = new SeoService()); }
Retrieves the seo service instance.
/* Access the seo service instance from anywhere */
const seoService = SeoService.Instance;

/* Access the seo service instance from within a page */
const seoService = this.seoService;

SetDefaultTags

SetDefaultTags(title?: string, description?: string, imageUrl?: string): void
Sets the given title, description, and image url for a page. The parameters are optional and will default back the index.html when not set values.
/* from within a page */
this.seoService.SetDefaultTags(this.Title, this.Description, this.ImageUrl);

SetTitle

SetTitle(title: string): void
Sets the head element value.</div>

SetDescription

SetDescription(description: string): void
Sets the meta description tag.

SetImageUrl

SetImageUrl(imageUrl: string): void
Sets the og:image meta tag.

SetMetaTags

SetMetaTags(metaTags: Array<MetaTag>): void
Sets any number of given meta tags.

RemoveTags

 RemoveTags(...tagNames: Array<string>): void;
Removes any number of given meta tags.