-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
When using the ngFor loop and two-way data-binding, I want to receive better error message #21914
Comments
@splincode This is not related to This would cause problems too : <div *ngFor="let car of cars">
<car-entity [(value)]="car"></car-entity>
</div> But this would be fine (assuming a variable named <car-entity [(value)]="myCar"></car-entity>
<div *ngFor="let car of cars">
<car-entity [value]="car"></car-entity>
</div> |
Duplicate of #17144 |
#19819 |
By convention "better error message" should be consider feature request rather than bug report, also it's better to update the title & description for not making others confused. |
I do renamed issue |
Analogia: const items = [1, 2, 3]
for (let item of items) {
item = item + 1
} But I can: const items = [{a: 1}, {a: 2}, {a: 3}]
for (let item of items) {
item.a++;
} // item - is object, we can mutate this, and saved immutable links |
Don't mix up a template for loop and typescript for loops: they do not work the same. |
The error was |
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. |
I'm submitting a...
Current behavior
I use Primeng components. When I use ng-templates, I can not create a component, with a link to the instance. Angular compiler sends incomprehensible errors.
https://stackblitz.com/edit/angular-eiskqo?file=app/app.component.html
Expected behavior
If you comment on a piece of code, you can see that
car
is an object that you can use in the future. But I can not create a component ...https://stackblitz.com/edit/angular-bd7std?file=app/app.component.html
Of course, you can bypass the error in this way:
But in my opinion this is a cant, if we can not normally logically handle the code according to the syntax [(**)]. I would like to know the cause of the error.
https://stackblitz.com/edit/angular-c356jp?file=app/app.component.html
Minimal reproduction of the problem with instructions
https://stackblitz.com/edit/angular-eiskqo?file=app/app.component.html
The text was updated successfully, but these errors were encountered: