Skip to content

Commit

Permalink
docs: list supported values for read in decorator metadata (#42370)
Browse files Browse the repository at this point in the history
fixes #20927

PR Close #42370
  • Loading branch information
atscott authored and AndrewKushnir committed Jun 1, 2021
1 parent 35ec0f9 commit bf931d3
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions packages/core/src/metadata/di.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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'}
Expand Down Expand Up @@ -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'}
Expand Down Expand Up @@ -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'}
Expand Down

0 comments on commit bf931d3

Please sign in to comment.