Skip to content
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

feat(ChangeDetectorRef): make detectChanges() correct #8599

Closed

Conversation

lacolaco
Copy link
Contributor

@lacolaco lacolaco commented May 11, 2016

What is the current behavior? (You can also link to an open issue here)

ChangeDetectorRef.detectChanges() is skipped if it is detached.

What is the new behavior?

ChangeDetectorRef.detectChanges() executes detection even if it is detached.

Does this PR introduce a breaking change?
No

Other information:

Close #8597

@mhevery
Copy link
Contributor

mhevery commented May 25, 2016

@vsavkin and @tbosch I would like to get your opinion on this

@tbosch
Copy link
Contributor

tbosch commented May 26, 2016

A simpler solution would be this:
Move the check for ChangeDetectorMode.Detached into the loop where a parent view calls its children (i.e. AppView. detectContentChildrenChanges / AppView. detectViewChildrenChanges). Then ChangeDetectorRef.detectChanges() should works as expected.

@mhevery
Copy link
Contributor

mhevery commented May 26, 2016

@laco0416 can you implement #8599 (comment) so that we can get this merged in?

@lacolaco
Copy link
Contributor Author

Ok, I see. I'll do that.

@lacolaco lacolaco force-pushed the laco-change-detector-ref-fix branch from 710fe25 to 9a1a20b Compare May 29, 2016 14:25
@lacolaco lacolaco changed the title feat(ChangeDetectorRef): add force optional argument feat(ChangeDetectorRef): make detectChanges() correct May 29, 2016
@lacolaco
Copy link
Contributor Author

@tbosch I've done. please review!

@tbosch tbosch closed this in 6028368 Jun 1, 2016
KiaraGrouwstra pushed a commit to KiaraGrouwstra/angular that referenced this pull request Jun 21, 2016
@lacolaco lacolaco deleted the laco-change-detector-ref-fix branch July 19, 2016 09:49
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(core): ChangeDetectorRef.detectChanges() doesn't work as well as its spec.
4 participants