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:
parent
4e73b8820a
commit
40da386a4d
|
@ -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;`)
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue