Skip to content

fix(ChangeDetection): ngAfterViewChecked is called when ChangeDetecto…#9309

Closed
alfonso-presa wants to merge 1 commit into
angular:masterfrom
alfonso-presa:fixLifecycleEventsWhenDetached
Closed

fix(ChangeDetection): ngAfterViewChecked is called when ChangeDetecto…#9309
alfonso-presa wants to merge 1 commit into
angular:masterfrom
alfonso-presa:fixLifecycleEventsWhenDetached

Conversation

@alfonso-presa

@alfonso-presa alfonso-presa commented Jun 17, 2016

Copy link
Copy Markdown
Contributor

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x")

[X] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

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

When ChangeDetector is detached ngViewChecked, ngContentChecked, ngDoChecked and ngOnChanges are triggered during a CD cycle.

What is the new behavior?

When ChangeDetector is detached ngViewChecked, ngContentChecked, ngDoChecked and ngOnChanges are NOT triggered during the CD cycle.

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[X] No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

ngDoCheck, ngAfterViewChecked, ngAfterContentChecked and ngOnChanges should not be invoked when ChangeDetector is detached.

fixes #7054

…r is detached

ngDoCheck, ngAfterViewChecked, ngAfterContentChecked and ngOnChanges should not be invoked when ChangeDetector is detached.

fixes angular#7057
@timruffles

Copy link
Copy Markdown
Contributor

Looks good after a quick look over. Why did you end up closing it?

@timruffles

Copy link
Copy Markdown
Contributor

Ah right - you're referring to changeDetectorRef which isn't going to be present for most components?

@alfonso-presa

alfonso-presa commented Jun 19, 2016

Copy link
Copy Markdown
Contributor Author

Yes... that reference was created by my own test :-S. Anyway I uploaded this one #9317 which I think is the good way of handling the issue.

@angular-automatic-lock-bot

Copy link
Copy Markdown

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 8, 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.

fix(ChangeDetection): ngAfterViewChecked is called when ChangeDetector is detached

3 participants