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

Class AppComponent

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

Source from the content-addressed store, hash-verified

34 describe('view', () => {
35 it('should query for an optional element in a template', () => {
36 @Component({
37 template: `<div #el></div>`,
38 })
39 class AppComponent {
40 divEl = viewChild<ElementRef<HTMLDivElement>>('el');
41 foundEl = computed(() => this.divEl() != null);
42 }
43
44 const fixture = TestBed.createComponent(AppComponent);
45 // with signal based queries we _do_ have query results after the creation mode

Callers

nothing calls this directly

Calls 6

ComponentInterface · 0.90
computedFunction · 0.90
signalFunction · 0.90
viewChildrenFunction · 0.90
injectFunction · 0.90
requiredMethod · 0.45

Tested by

no test coverage detected