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

Function clearInertBodyElement

packages/core/src/sanitization/html_sanitizer.ts:346–351  ·  view source on GitHub ↗
(inertBodyElement: HTMLElement)

Source from the content-addressed store, hash-verified

344}
345
346function clearInertBodyElement(inertBodyElement: HTMLElement): void {
347 const parent = getTemplateContent(inertBodyElement) || inertBodyElement;
348 while (parent.firstChild) {
349 parent.firstChild.remove();
350 }
351}
352
353export function getTemplateContent(el: Node): Node | null {
354 return 'content' in (el as any) /** Microsoft/TypeScript#21517 */ && isTemplateElement(el)

Callers 1

_sanitizeHtmlFunction · 0.85

Calls 2

getTemplateContentFunction · 0.85
removeMethod · 0.65

Tested by

no test coverage detected