docs(core): fix `ViewChildren` code examples to avoid TS error (#42816)

Add a non-null assertion (`!`) in `ViewChildren` code examples to avoid
a TypeScript error due to uninitialized property.

Fixes #42811

PR Close #42816
This commit is contained in:
behrooz bozorg chami 2021-07-11 00:36:22 +04:30 committed by Andrew Kushnir
parent 4e73b8820a
commit 40da386a4d
1 changed files with 3 additions and 3 deletions

View File

@ -337,9 +337,9 @@ export interface ViewChildrenDecorator {
* * A template reference variable as a string (e.g. query `<my-component #cmp></my-component>`
* with `@ViewChildren('cmp')`)
* * Any provider defined in the child component tree of the current component (e.g.
* `@ViewChildren(SomeService) someService: SomeService`)
* * Any provider defined through a string token (e.g. `@ViewChildren('someToken') someTokenVal:
* any`)
* `@ViewChildren(SomeService) someService!: SomeService`)
* * Any provider defined through a string token (e.g. `@ViewChildren('someToken')
* someTokenVal!: any`)
* * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with `@ViewChildren(TemplateRef)
* template;`)
*