MCPcopy Create free account
hub / github.com/angular/angular / updateTag

Method updateTag

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

* Modifies an existing ` ` tag element in the current HTML document. * @param tag The tag description with which to replace the existing tag content. * @param selector A tag attribute and value to match against, to identify * an existing tag. A string in the format `"tag_attribute=`val

(tag: MetaDefinition, selector?: string)

Source from the content-addressed store, hash-verified

124 * @return The modified element.
125 */
126 updateTag(tag: MetaDefinition, selector?: string): HTMLMetaElement | null {
127 selector ??= parseSelector(tag);
128 const meta = this.getTag(selector);
129 if (meta) {
130 setMetaElementAttributes(tag, meta);
131 return meta;
132 }
133 return this._getOrCreateElement(tag, true);
134 }
135
136 /**
137 * Removes an existing `<meta>` tag element from the current HTML document.

Callers 2

meta_spec.tsFile · 0.80
updateTitleMethod · 0.80

Calls 4

getTagMethod · 0.95
_getOrCreateElementMethod · 0.95
parseSelectorFunction · 0.85
setMetaElementAttributesFunction · 0.85

Tested by

no test coverage detected