docs: list supported values for `read` in decorator metadata (#42370)

fixes #20927

PR Close #42370
This commit is contained in:
Andrew Scott 2021-05-26 14:25:16 -07:00 committed by Andrew Kushnir
parent e798bfabb0
commit 1b8bbddff5
1 changed files with 28 additions and 0 deletions

View File

@ -154,6 +154,13 @@ export interface ContentChildrenDecorator {
* removed in future versions of Angular.
* * **read** - Used to read a different token from the queried elements.
*
* The following values are supported by `read`:
* * Any class with the `@Component` or `@Directive` decorator
* * Any provider defined on the injector of the component that is matched by the `selector` of
* this query
* * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)
* * `TemplateRef`, `ElementRef`, and `ViewContainerRef`
*
* @usageNotes
*
* Here is a simple demonstration of how the `ContentChildren` decorator can be used.
@ -230,6 +237,13 @@ export interface ContentChildDecorator {
* * **static** - True to resolve query results before change detection runs,
* false to resolve after change detection. Defaults to false.
*
* The following values are supported by `read`:
* * Any class with the `@Component` or `@Directive` decorator
* * Any provider defined on the injector of the component that is matched by the `selector` of
* this query
* * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)
* * `TemplateRef`, `ElementRef`, and `ViewContainerRef`
*
* @usageNotes
*
* {@example core/di/ts/contentChild/content_child_howto.ts region='HowTo'}
@ -293,6 +307,13 @@ export interface ViewChildrenDecorator {
* ** Note: *** This config option is **deprecated**, it will be permanently set to `true` and
* removed in future versions of Angular.
*
* The following values are supported by `read`:
* * Any class with the `@Component` or `@Directive` decorator
* * Any provider defined on the injector of the component that is matched by the `selector` of
* this query
* * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)
* * `TemplateRef`, `ElementRef`, and `ViewContainerRef`
*
* @usageNotes
*
* {@example core/di/ts/viewChildren/view_children_howto.ts region='HowTo'}
@ -368,6 +389,13 @@ export interface ViewChildDecorator {
* * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with `@ViewChild(TemplateRef)
* template;`)
*
* The following values are supported by `read`:
* * Any class with the `@Component` or `@Directive` decorator
* * Any provider defined on the injector of the component that is matched by the `selector` of
* this query
* * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)
* * `TemplateRef`, `ElementRef`, and `ViewContainerRef`
*
* @usageNotes
*
* {@example core/di/ts/viewChild/view_child_example.ts region='Component'}