()
| 336 | } |
| 337 | |
| 338 | private _clearSvgElement() { |
| 339 | const layoutElement: HTMLElement = this._elementRef.nativeElement; |
| 340 | let childCount = layoutElement.childNodes.length; |
| 341 | |
| 342 | if (this._elementsWithExternalReferences) { |
| 343 | this._elementsWithExternalReferences.clear(); |
| 344 | } |
| 345 | |
| 346 | // Remove existing non-element child nodes and SVGs, and add the new SVG element. Note that |
| 347 | // we can't use innerHTML, because IE will throw if the element has a data binding. |
| 348 | while (childCount--) { |
| 349 | const child = layoutElement.childNodes[childCount]; |
| 350 | |
| 351 | // 1 corresponds to Node.ELEMENT_NODE. We remove all non-element nodes in order to get rid |
| 352 | // of any loose text nodes, as well as any SVG elements in order to remove any old icons. |
| 353 | if (child.nodeType !== 1 || child.nodeName.toLowerCase() === 'svg') { |
| 354 | child.remove(); |
| 355 | } |
| 356 | } |
| 357 | } |
| 358 | |
| 359 | private _updateFontIconClasses() { |
| 360 | if (!this._usingFontIcon()) { |
no test coverage detected