-
-
Notifications
You must be signed in to change notification settings - Fork 248
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
ngFor broken in child components with delayed initialization #2361
Comments
Hey! Actually, the issue isn't on ngFor does The new angular integration has just been released (https://blog.nativescript.org/nativescript-angular-12/index.html) and we're wondering on how to best handle this case. Here are the options and pros/cons:
It seems there isn't an easy way out of this. On one hand, the event is firing correctly when it should, on the other, it's frustrating to use Part of me says we should make clear that |
Environment
Provide version numbers for the following components (information can be retrieved by running
tns info
in your project folder or by inspecting thepackage.json
of the project):Describe the bug
Using ngFor in child components (embedded via template selector in HTML) when child component is initialized with a delay,
such as with ngIf or ngSwitch with a false initial value, is broken. The loop executes the correct number of times, but every item is either null or undefined and other loop variables are wrong too, e.g. index is -1 for every iteration.
Edit: After more testing, it seems you don't even need a child component. If ngFor array is set from a promise, ngFor breaks as described.
To Reproduce
Expected behavior
Sample project
https://github.com/OzymandiasTheGreat/nativescript-ngfor-bug
It's the ng-blank template with an additional child component. Just running the example prints what I'm describing.
Additional context
The text was updated successfully, but these errors were encountered: