-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Closed
Labels
bugcore: reactivityWork related to fine-grained reactivity in the core frameworkWork related to fine-grained reactivity in the core frameworkcross-cutting: signals
Description
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
Using a private property (e.g. #children) with viewChildren() or viewChild() will silently fail, and never update the counts. This is likely also the same for contentChild() and contentChildren(). This also means that retrieving the signal in an effect() will also never trigger outside of the initial run.
Current workaround is to use private myProp = viewChildren('selector');, which will work as intended while still hiding the property from being public.
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/stackblitz-starters-lsgmpz?file=src%2Fmain.ts
Please provide the exception or error you saw
A `viewChildren()` on a public property (`elements`) will log 1, while a `viewChildren()` on private property (`#elements`) will log 0.
Please provide the environment you discovered this bug in (run ng version)
Angular: 17.3.0
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1703.0
@angular-devkit/build-angular 17.3.0
@angular-devkit/core 17.3.0
@angular-devkit/schematics 17.3.0
@schematics/angular 17.3.0
rxjs 7.8.1
typescript 5.3.3
zone.js 0.14.4
Anything else?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugcore: reactivityWork related to fine-grained reactivity in the core frameworkWork related to fine-grained reactivity in the core frameworkcross-cutting: signals
Type
Projects
Status
Done