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

UI-router prevents navigation to other apps #53

Closed
klaimmore opened this issue Dec 14, 2020 · 3 comments
Closed

UI-router prevents navigation to other apps #53

klaimmore opened this issue Dec 14, 2020 · 3 comments

Comments

@klaimmore
Copy link

If an angularjs app with ui-router defines default urls with $urlRouterProvider.otherwise('/default');
Then navigating away from that app is no longer possible.

I uploaded an example of the issue here

Navigating from app1 to app2 is possible, but not the other way around.

I added a custom unmount function that resolve the issue when using ui-router>1. By calling dispose() on the $uiRouter instance:

angular.element(document.getElementById('main')).children('.ng-scope').injector().get('$uiRouter').dispose();

But it relies on locating the app's injector.

@joeldenning
Copy link
Member

Thanks for creating the demonstration repo, and for investigating a fix. I created klaimmore/angularjs-uirouter-microfrontend#1 which uses a modified version of single-spa-angularjs that fixes it for both app1 and app2.

I'll also put together a PR to single-spa-angularjs with the fix so we can get it merged and published.

@joeldenning
Copy link
Member

I've created #54 which implements this fix.

@joeldenning
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants