single-spa / single-spa-angular

Helpers for building single-spa applications which use Angular
Apache License 2.0
198 stars 78 forks source link

change detection is not working with lazy loading module #139

Closed HemTech closed 4 years ago

HemTech commented 4 years ago

we are using angular 8 with single spa. we have implemented lazy loading and notice an issue when lazy loading module have multiple child routes and you navigate from one child route to another.

we have created a sample app using the microfronend demo app. https://github.com/joeldenning/coexisting-angular-microfrontends

Updated Repo (Added lazy loading module): https://gitlab.com/Hemendra.patel/coexisting-angular-microfrontends

Step 1: click on link-app1 step 2: click on 'Click To Toggle' button Angular will update the 'test' property value Step 3: click on 'Navigation to next route' button it will redirect to widgetDetails Step 4: click on 'Back' back button - step 5 : click on 'Click To Toggle' button again - now angular change detection will not working.

we can add ChangeDetectorRef to manually trigger the change detection but we need to add it on each client event to get the update.

joeldenning commented 4 years ago

Duplicate of https://github.com/single-spa/single-spa-angular/issues/94. I'm closing this in favor of that issue - feel free to comment there.