W3cubDocs

/Angular

Meta

class experimental

A service that can be used to get and add meta tags.

class Meta {
  constructor(_doc: any)
  addTag(tag: MetaDefinition, forceCreation: boolean = false): HTMLMetaElement | null
  addTags(tags: MetaDefinition[], forceCreation: boolean = false): HTMLMetaElement[]
  getTag(attrSelector: string): HTMLMetaElement | null
  getTags(attrSelector: string): HTMLMetaElement[]
  updateTag(tag: MetaDefinition, selector?: string): HTMLMetaElement | null
  removeTag(attrSelector: string): void
  removeTagElement(meta: HTMLMetaElement): void
}

Constructor

constructor(_doc: any)

Parameters

_doc

Type: any.

Methods

addTag()

addTag(tag: MetaDefinition, forceCreation: boolean = false): HTMLMetaElement | null

Parameters

tag

Type: MetaDefinition.

forceCreation

Type: boolean.

Optional. Default is false.

Returns

HTMLMetaElement | null

addTags()

addTags(tags: MetaDefinition[], forceCreation: boolean = false): HTMLMetaElement[]

Parameters

tags

Type: MetaDefinition[].

forceCreation

Type: boolean.

Optional. Default is false.

Returns

HTMLMetaElement[]

getTag()

getTag(attrSelector: string): HTMLMetaElement | null

Parameters

attrSelector

Type: string.

Returns

HTMLMetaElement | null

getTags()

getTags(attrSelector: string): HTMLMetaElement[]

Parameters

attrSelector

Type: string.

Returns

HTMLMetaElement[]

updateTag()

updateTag(tag: MetaDefinition, selector?: string): HTMLMetaElement | null

Parameters

tag

Type: MetaDefinition.

selector

Type: string.

Optional. Default is undefined.

Returns

HTMLMetaElement | null

removeTag()

removeTag(attrSelector: string): void

Parameters

attrSelector

Type: string.

Returns

void

removeTagElement()

removeTagElement(meta: HTMLMetaElement): void

Parameters

meta

Type: HTMLMetaElement.

Returns

void

Annotations

@Injectable()

© 2010–2018 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/api/platform-browser/Meta