Skip to content

Deleting element in ngFor not given correct data after that to display #21068

@Alkasih

Description

@Alkasih

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

data [
     {name: "jack", background:blob.jack.jpg},
     {name: "rose", background:blob.rose.jpg},
     {name: "philip", background:blob.philip.jpg},
     {name: "paul", background:blob.paul.jpg},
]

I am using a background image for each container with loop of object. And when
deleting one element/object from array in ngFor, it doesn't give the correct background image after that to display, while the object in array and their value are still aranged correctly.

Expected behavior

Minimal reproduction of the problem with instructions

https://stackoverflow.com/questions/47847409/delete-file-value-from-loop-array-will-mess-up-the-container-background-angula

I have opened a question a day ago to SO, but seems like no one can fix it.

What is the motivation / use case for changing the behavior?

Environment


Angular version: 5.0.3


Browser:
- [X] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [X] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreIssues related to the framework runtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions