MCPcopy
hub / github.com/angular/angular / QueryDir

Class QueryDir

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

Source from the content-addressed store, hash-verified

324
325 it('should run content queries defined on directives', () => {
326 @Directive({
327 selector: '[query]',
328 host: {'[textContent]': `noOfEls()`},
329 })
330 class QueryDir {
331 elements = contentChildren('el');
332 element = contentChild('el');
333 elementReq = contentChild.required('el');
334
335 noOfEls = computed(
336 () =>
337 this.elements().length +
338 (this.element() !== undefined ? 1 : 0) +
339 (this.elementReq() !== undefined ? 1 : 0),
340 );
341 }
342
343 @Component({
344 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…