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

Why do I get the sign "?" at the start of the URL and reboot the app when navigating the absolute path? #27056

Closed
Bratchvv opened this issue Nov 11, 2018 · 4 comments

Comments

@Bratchvv
Copy link

Bratchvv commented Nov 11, 2018

I have problem.

I have a multi-module application with lazy loading.
When I navigate from top module to bottom child module, everything is fine.
But when I try to route from a bottom child lazy module to another child lazy module, I get strange behavior.

It's ok :

=> http://localhost:4200/#/op/services/ =>
=> http://localhost:4200/#/op/services/management/ =>
=> http://localhost:4200/#/op/services/management/edit/123

=> http://localhost:4200/#/op
=> http://localhost:4200/#/op/test/management/
=> http://localhost:4200/#/op/test/management/edit/321

This is bad:

http://localhost:4200/#/op/test/management/edit/321 =>
=> http://localhost:4200/#/op/services/management/edit/123

When I try it, I got '?' sign in start URL, like http://localhost:4200/?#/op/services/management/edit/123,
and my app was full reload!

It doesn't matter if a lazy module is loaded or not, as I found out, this does not affect the problem.

This problem is repeated unstable, sometimes the transition works as expected!
I tried many combinations, but the problem can not solve.

That I tried:
this.router.navigate([op/services/management/edit/${id}]);
this.router.navigate([/op/services/management/edit/${id}]);
this.router.navigate(['/op/services/management/edit/', id]);

this.router.navigateByUrl(op/services/management/edit/${id});
this.router.navigateByUrl(/op/services/management/edit/${id});

routerLink = "/op/services/management/edit/123"
routerLink = "op/services/management/edit/123"

Help me understand why the route changes?

@sarunint
Copy link
Contributor

This sounds like a support question, please use StackOverflow or Gitter for that.

@Bratchvv
Copy link
Author

I try it too.
But, reloading app, when I route to the page makes me think that this is a bug

@Bratchvv
Copy link
Author

I'm sorry my mistake)
The button to go to the desired route had a default type, that is, 'submit', and its button was in form...
Change it to type='button' and all work fine!

@angular-automatic-lock-bot
Copy link

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 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants