Add solution to zoneless routing in @ngrx/component
?
#3732
dominicegginton
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I encountered an issue with the Angular
Router
in a zoneless application and believe a simple solution could be provided by@ngrx/component
.The problem:
The
ngOnInit
lifecycle hook of the routed component is not called in a zoneless configuration. This is due to theRouter
internally callingChangeDetectorRef.markForCheck()
upon route activation. In a zonless configuration, this will not trigger change detection.Proposed Solution:
A new directive that listens to the
(activate)
event of theRouterOutlet
and calls theChangeDetectorRef.detectChanges()
method:Resources
Beta Was this translation helpful? Give feedback.
All reactions