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

Method _setSvgElement

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

Source from the content-addressed store, hash-verified

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

Callers 1

_updateSvgIconMethod · 0.95

Tested by

no test coverage detected