| 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 |