New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QueryList initialized properties regression #21980
Labels
area: core
Issues related to the framework runtime
Comments
emilio-martinez
added a commit
to emilio-martinez/angular
that referenced
this issue
Feb 2, 2018
3 tasks
emilio-martinez
added a commit
to emilio-martinez/angular
that referenced
this issue
Feb 2, 2018
Set initial value of `length` to `0`. Fixes regression introduced by angular@e544742#diff-a85dbe0991a7577ea24b49374e9ae90b where the `length` property ceased to have initial value.
Added PR. |
emilio-martinez
added a commit
to emilio-martinez/angular
that referenced
this issue
Feb 7, 2018
Set initial value of `length` to `0`. Fixes regression introduced by angular@e544742#diff-a85dbe0991a7577ea24b49374e9ae90b where the `length` property ceased to have initial value. Closes angular#21980
mhevery
pushed a commit
that referenced
this issue
Feb 7, 2018
Set initial value of `length` to `0`. Fixes regression introduced by e544742#diff-a85dbe0991a7577ea24b49374e9ae90b where the `length` property ceased to have initial value. Closes #21980 PR Close #21982
jbogarthyde
pushed a commit
to jbogarthyde/angular
that referenced
this issue
Feb 23, 2018
…ngular#21982) Set initial value of `length` to `0`. Fixes regression introduced by angular@e544742#diff-a85dbe0991a7577ea24b49374e9ae90b where the `length` property ceased to have initial value. Closes angular#21980 PR Close angular#21982
leo6104
pushed a commit
to leo6104/angular
that referenced
this issue
Mar 25, 2018
…ngular#21982) Set initial value of `length` to `0`. Fixes regression introduced by angular@e544742#diff-a85dbe0991a7577ea24b49374e9ae90b where the `length` property ceased to have initial value. Closes angular#21980 PR Close angular#21982
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm submitting a...
Current behavior
I believe I've found a regression issue with
QueryList
, possibly caused by this commit: e544742#diff-a85dbe0991a7577ea24b49374e9ae90b.I stumbled upon this in an isolated test, i.e., I'm just testing the class logic, not rendering the component. The component has a property decorated with
@ViewChildren
and has other logic that depends of theQueryList
length. So for testing purposes, I "manually" instantiate aQueryList
because, of course, it would be automatically populated when outside of Angular's purview. This is where the issue comes in:Previously (Angular 5.1.3, in my case),
queryListInstance.length
used to have an initial value of0
because it was a getter for the_result
array length. Upon upgrading to Angular 5.2.3, it's nowundefined
. Now to actually have it populated, the usereset()
is required:I've only been impacted by this in isolated tests.
ViewChildren
's logic, however, through it's use ofQueryList
'sreset()
makes the change imperceptible when the component is rendered.Expected behavior
Minimal reproduction of the problem with instructions
The below examples show how
QueryList
behavior changed when usingnew QueryList()
. Also showcased,QueryLists
via@ViewChildren
haven't changed in practice; however, in Angular 5.2.3, the length must be getting initialized via callingreset()
behind the scenes.With Angular 5.1.3: https://stackblitz.com/edit/angular-akgclx
With Angular 5.2.3: https://stackblitz.com/edit/angular-tcnwtn
What is the motivation / use case for changing the behavior?
Regression
Environment
The text was updated successfully, but these errors were encountered: