MCPcopy Create free account
hub / github.com/angular/components / _setSvgElement

Method _setSvgElement

src/material/icon/icon.ts:328–338  ·  view source on GitHub ↗
(svg: SVGElement)

Source from the content-addressed store, hash-verified

326 }
327
328 private _setSvgElement(svg: SVGElement) {
329 this._clearSvgElement();
330
331 // Note: we do this fix here, rather than the icon registry, because the
332 // references have to point to the URL at the time that the icon was created.
333 const path = this._location.getPathname();
334 this._previousPath = path;
335 this._cacheChildrenWithExternalReferences(svg);
336 this._prependPathToReferences(path);
337 this._elementRef.nativeElement.appendChild(svg);
338 }
339
340 private _clearSvgElement() {
341 const layoutElement: HTMLElement = this._elementRef.nativeElement;

Callers 1

_updateSvgIconMethod · 0.95

Tested by

no test coverage detected