-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Proposal: smarter change detection #22646
Copy link
Copy link
Closed
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimecore: change detectionfeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issuesfeature: under considerationFeature request for which voting has completed and the request is now under considerationFeature request for which voting has completed and the request is now under consideration
Milestone
Description
I created sad-hover component which is really sad at the moment. Here is stackblitz https://stackblitz.com/edit/angular-sad-hover?file=app%2Fapp.component.ts Open developer tools to see console output.
Problem:
- I have isolated
sad-hovercomponent which uses OnPush. - Inside it I use (mouseleave) and (mouseover) and I don't want to trigger my whole app change detection to run.
- This component is used in parent
sad-catcomponent, andsad-catis used on root app component. - It turns out that zone is still grabbing these events and triggers parent component and root to update.
Solution:
Allow to have truly isolate component so everything that I make inside will stay inside, but I'm still be able to notify parent components about changes by using @Output();
One solution could be to allow inject zone and say than I don't want to trigger any parent's component's CD.
class MyIsolatedCmp {
constructor(zone: NgZone) {
zone.SkipParent();
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimecore: change detectionfeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issuesfeature: under considerationFeature request for which voting has completed and the request is now under considerationFeature request for which voting has completed and the request is now under consideration