From 66547d8fd06ad730045572afdf476a2c17e71a4f Mon Sep 17 00:00:00 2001 From: vincecampanale Date: Wed, 14 Mar 2018 21:01:49 -0400 Subject: [PATCH] docs(core): clarify supported ViewChild selectors (#22784) PR Close #22784 --- packages/core/src/metadata/di.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/core/src/metadata/di.ts b/packages/core/src/metadata/di.ts index c568bbdf18..944a49fbf4 100644 --- a/packages/core/src/metadata/di.ts +++ b/packages/core/src/metadata/di.ts @@ -321,8 +321,21 @@ export interface ViewChildDecorator { * * **selector** - the directive type or the name used for querying. * * **read** - read a different token from the queried elements. * + * Supported selectors include: + * * any class with the `@Component` or `@Directive` decorator + * * a template reference variable as a string (e.g. query ` + * with `@ViewChild('cmp')`) + * * any provider defined in the child component tree of the current component (e.g. + * `@ViewChild(SomeService) someService: SomeService`) + * * any provider defined through a string token (e.g. `@ViewChild('someToken') someTokenVal: + * any`) + * * a `TemplateRef` (e.g. query `` with `@ViewChild(TemplateRef) + * template;`) + * * @usageNotes * + * {@example core/di/ts/viewChild/view_child_example.ts region='Component'} + * * ### Example * * {@example core/di/ts/viewChild/view_child_howto.ts region='HowTo'}