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

Class QueryDir

packages/core/test/acceptance/authoring/signal_queries_spec.ts:377–392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375
376 it('should run content queries defined on directives', () => {
377 @Directive({
378 selector: '[query]',
379 host: {'[textContent]': `noOfEls()`},
380 })
381 class QueryDir {
382 elements = contentChildren('el');
383 element = contentChild('el');
384 elementReq = contentChild.required('el');
385
386 noOfEls = computed(
387 () =>
388 this.elements().length +
389 (this.element() !== undefined ? 1 : 0) +
390 (this.elementReq() !== undefined ? 1 : 0),
391 );
392 }
393
394 @Component({
395 imports: [QueryDir],

Callers

nothing calls this directly

Calls 5

DirectiveClass · 0.90
contentChildrenFunction · 0.90
computedFunction · 0.90
elementMethod · 0.80
requiredMethod · 0.45

Tested by

no test coverage detected