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

Function getNgContentAttr

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

Source from the content-addressed store, hash-verified

551 const secondParentEl: HTMLElement = fixture.nativeElement.querySelector('parent-comp');
552 const elementFromRenderer: HTMLElement = fixture.nativeElement.querySelector('p');
553 const getNgContentAttr = (element: HTMLElement) => {
554 return Array.from(element.attributes)
555 .map((a) => a.name)
556 .find((a) => /ngcontent/.test(a));
557 };
558
559 const hostNgContentAttr = getNgContentAttr(secondParentEl);
560 const viewNgContentAttr = getNgContentAttr(elementFromRenderer);

Callers 1

component_spec.tsFile · 0.85

Calls 4

mapMethod · 0.80
findMethod · 0.45
fromMethod · 0.45
testMethod · 0.45

Tested by

no test coverage detected