fix(core): require 'static' flag on queries in typings (#30639)
This commit makes the static flag on @ViewChild and @ContentChild required. BREAKING CHANGE: In Angular version 8, it's required that all @ViewChild and @ContentChild queries have a 'static' flag specifying whether the query is 'static' or 'dynamic'. The compiler previously sorted queries automatically, but in 8.0 developers are required to explicitly specify which behavior is wanted. This is a temporary requirement as part of a migration; see https://angular.io/guide/static-query-migration for more details. @ViewChildren and @ContentChildren queries are always dynamic, and so are unaffected. PR Close #30639
This commit is contained in:

committed by
Matias Niemelä

parent
dc6406e5e8
commit
84dd2679a9
18
tools/public_api_guard/core/core.d.ts
vendored
18
tools/public_api_guard/core/core.d.ts
vendored
@ -168,13 +168,13 @@ export interface ConstructorSansProvider {
|
||||
export declare type ContentChild = Query;
|
||||
|
||||
export interface ContentChildDecorator {
|
||||
(selector: Type<any> | Function | string, opts?: {
|
||||
(selector: Type<any> | Function | string, opts: {
|
||||
read?: any;
|
||||
static?: boolean;
|
||||
static: boolean;
|
||||
}): any;
|
||||
new (selector: Type<any> | Function | string, opts?: {
|
||||
new (selector: Type<any> | Function | string, opts: {
|
||||
read?: any;
|
||||
static?: boolean;
|
||||
static: boolean;
|
||||
}): ContentChild;
|
||||
}
|
||||
|
||||
@ -1104,7 +1104,7 @@ export interface Query {
|
||||
isViewQuery: boolean;
|
||||
read: any;
|
||||
selector: any;
|
||||
static?: boolean;
|
||||
static: boolean;
|
||||
}
|
||||
|
||||
export declare abstract class Query {
|
||||
@ -1382,13 +1382,13 @@ export declare const VERSION: Version;
|
||||
export declare type ViewChild = Query;
|
||||
|
||||
export interface ViewChildDecorator {
|
||||
(selector: Type<any> | Function | string, opts?: {
|
||||
(selector: Type<any> | Function | string, opts: {
|
||||
read?: any;
|
||||
static?: boolean;
|
||||
static: boolean;
|
||||
}): any;
|
||||
new (selector: Type<any> | Function | string, opts?: {
|
||||
new (selector: Type<any> | Function | string, opts: {
|
||||
read?: any;
|
||||
static?: boolean;
|
||||
static: boolean;
|
||||
}): ViewChild;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user