test: clean up explicit dynamic query usages (#33015)
Cleans up all the places where we explicitly set `static: false` on queries. PR Close #33015
This commit is contained in:
@ -8,7 +8,7 @@ import { Component, ViewChild, ElementRef } from '@angular/core';
|
||||
})
|
||||
export class AppComponent {
|
||||
|
||||
@ViewChild('bindingInput', { static: false }) bindingInput: ElementRef;
|
||||
@ViewChild('bindingInput') bindingInput: ElementRef;
|
||||
|
||||
isUnchanged = true;
|
||||
|
||||
|
@ -39,7 +39,7 @@ export class CountdownLocalVarParentComponent { }
|
||||
})
|
||||
export class CountdownViewChildParentComponent implements AfterViewInit {
|
||||
|
||||
@ViewChild(CountdownTimerComponent, {static: false})
|
||||
@ViewChild(CountdownTimerComponent)
|
||||
private timerComponent: CountdownTimerComponent;
|
||||
|
||||
seconds() { return 0; }
|
||||
|
@ -34,7 +34,7 @@ export class AfterContentComponent implements AfterContentChecked, AfterContentI
|
||||
comment = '';
|
||||
|
||||
// Query for a CONTENT child of type `ChildComponent`
|
||||
@ContentChild(ChildComponent, {static: false}) contentChild: ChildComponent;
|
||||
@ContentChild(ChildComponent) contentChild: ChildComponent;
|
||||
|
||||
// #enddocregion hooks
|
||||
constructor(private logger: LoggerService) {
|
||||
|
@ -35,7 +35,7 @@ export class AfterViewComponent implements AfterViewChecked, AfterViewInit {
|
||||
private prevHero = '';
|
||||
|
||||
// Query for a VIEW child of type `ChildViewComponent`
|
||||
@ViewChild(ChildViewComponent, {static: false}) viewChild: ChildViewComponent;
|
||||
@ViewChild(ChildViewComponent) viewChild: ChildViewComponent;
|
||||
|
||||
// #enddocregion hooks
|
||||
constructor(private logger: LoggerService) {
|
||||
|
@ -81,7 +81,7 @@ export class DoCheckParentComponent {
|
||||
hero: Hero;
|
||||
power: string;
|
||||
title = 'DoCheck';
|
||||
@ViewChild(DoCheckComponent, {static: false}) childView: DoCheckComponent;
|
||||
@ViewChild(DoCheckComponent) childView: DoCheckComponent;
|
||||
|
||||
constructor() { this.reset(); }
|
||||
|
||||
|
@ -55,7 +55,7 @@ export class OnChangesParentComponent {
|
||||
hero: Hero;
|
||||
power: string;
|
||||
title = 'OnChanges';
|
||||
@ViewChild(OnChangesComponent, {static: false}) childView: OnChangesComponent;
|
||||
@ViewChild(OnChangesComponent) childView: OnChangesComponent;
|
||||
|
||||
constructor() {
|
||||
this.reset();
|
||||
|
@ -8,7 +8,7 @@ import { NgForm } from '@angular/forms';
|
||||
styleUrls: ['./app.component.css']
|
||||
})
|
||||
export class AppComponent {
|
||||
@ViewChild('itemForm', { static: false }) form: NgForm;
|
||||
@ViewChild('itemForm') form: NgForm;
|
||||
|
||||
private _submitMessage = '';
|
||||
|
||||
|
@ -13,7 +13,7 @@ import { Hero } from './hero';
|
||||
})
|
||||
export class HeroFormComponent {
|
||||
@Input() hero: Hero;
|
||||
@ViewChild('heroForm', {static: false}) form: NgForm;
|
||||
@ViewChild('heroForm') form: NgForm;
|
||||
|
||||
// tslint:disable-next-line:variable-name
|
||||
private _submitMessage = '';
|
||||
|
@ -6,7 +6,7 @@ import { Component, AfterViewInit, ViewChild, ElementRef } from '@angular/core';
|
||||
})
|
||||
export class CanvasComponent implements AfterViewInit {
|
||||
blobSize: number;
|
||||
@ViewChild('sampleCanvas', {static: false}) sampleCanvas: ElementRef;
|
||||
@ViewChild('sampleCanvas') sampleCanvas: ElementRef;
|
||||
|
||||
constructor() { }
|
||||
|
||||
|
Reference in New Issue
Block a user