MCPcopy
hub / github.com/angular/angular / addTag

Method addTag

packages/platform-browser/src/browser/meta.ts:74–77  ·  view source on GitHub ↗

* Retrieves or creates a specific ` ` tag element in the current HTML document. * In searching for an existing tag, Angular attempts to match the `name` or `property` attribute * values in the provided tag definition, and verifies that all other attribute values are equal. * If an exis

(tag: MetaDefinition, forceCreation: boolean = false)

Source from the content-addressed store, hash-verified

72 * the new element if no match is found, or `null` if the tag parameter is not defined.
73 */
74 addTag(tag: MetaDefinition, forceCreation: boolean = false): HTMLMetaElement | null {
75 if (!tag) return null;
76 return this._getOrCreateElement(tag, forceCreation);
77 }
78
79 /**
80 * Retrieves or creates a set of `<meta>` tag elements in the current HTML document.

Callers 1

meta_spec.tsFile · 0.80

Calls 1

_getOrCreateElementMethod · 0.95

Tested by

no test coverage detected