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:
crisbeto
2019-10-05 10:04:54 +02:00
committed by Matias Niemelä
parent 7e64bbe5a8
commit 9d54679e66
46 changed files with 273 additions and 279 deletions

View File

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

View File

@ -39,7 +39,7 @@ export class CountdownLocalVarParentComponent { }
})
export class CountdownViewChildParentComponent implements AfterViewInit {
@ViewChild(CountdownTimerComponent, {static: false})
@ViewChild(CountdownTimerComponent)
private timerComponent: CountdownTimerComponent;
seconds() { return 0; }

View File

@ -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) {

View File

@ -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) {

View File

@ -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(); }

View File

@ -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();

View File

@ -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 = '';

View File

@ -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 = '';

View File

@ -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() { }