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

Function getNgContentAttr

packages/core/test/acceptance/component_spec.ts:576–580  ·  view source on GitHub ↗
(element: HTMLElement)

Source from the content-addressed store, hash-verified

574 const secondParentEl: HTMLElement = fixture.nativeElement.querySelector('parent-comp');
575 const elementFromRenderer: HTMLElement = fixture.nativeElement.querySelector('p');
576 const getNgContentAttr = (element: HTMLElement) => {
577 return Array.from(element.attributes)
578 .map((a) => a.name)
579 .find((a) => /ngcontent/.test(a));
580 };
581
582 const hostNgContentAttr = getNgContentAttr(secondParentEl);
583 const viewNgContentAttr = getNgContentAttr(elementFromRenderer);

Callers 1

component_spec.tsFile · 0.85

Calls 3

mapMethod · 0.80
findMethod · 0.45
testMethod · 0.45

Tested by

no test coverage detected