Skip to content

elements: change detection breaks in *ngFor loop #23841

@remackgeek

Description

@remackgeek

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x ] Bug report  
[ ] Performance issue
[ ] 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
[ ] Other... Please describe:

Current behavior

I create Element with an exposed property and an *ngFor in the template.
When setting the property via JavaScript, it breaks the the change detection/rendering of the *ngFor

Expected behavior

Change detection in the ngFor works the same as an unrolled loop.

Minimal reproduction of the problem with instructions

https://stackblitz.com/edit/angular-apfxkt?file=src%2Findex.html

in the first row,

  1. click on the first dot
  2. click on the give max rating" button
  3. click on the 4th dot
    Error: 5th dot remains red

Note that the second row, with an unrolled loop, works as expected

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

Environment


Angular version: 6.0.0


Browser:
- [x ] Chrome (desktop) version 66
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] 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

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions