-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Router upgrade does not work when initial state is Angular #18329
Comments
To avoid the sometimes unnecessary extra call, I think we could set up a listener for |
@jbedard included the workaround in his original comment 😁 |
This issue is quite old and I can't tell whether it is still relevant. I tried to reproduce it in this StackBlitz project, but couldn't. However, there are numerous ways to configure a dual router setup, so it might be something specific to my setup that avoids the problem. @jbedard, @aaronfrost: If you are still running into this issue, could you share a minimal reproduction, so we can confirm whether this is still an issue and investigate further? |
Looks like I removed the workaround for this just a couple months after filing this issue. It was after a couple upgrade/router related changes, but I'm not really sure which if any of those changes fixed it, or maybe it was fixed in an angular upgrade 🤷 One change I did right before dropping the workaround was changing what's in
to
(which was done for some reason related to protractor patching something, and doing Looks like that Our routing/upgrade/a1<=>2 logic has completely changed since then so I don't think it's worth me even trying to reproduce it atm |
After looking at your StackBlitz though... one big difference was that I had the Your StackBlitz also has no call to |
Yeah, it doesn't 😁 TBH, I am not sure what issue exactly I was trying to reproduce 😇 |
Since we can't seem to figure out exactly how to reproduce the issue here or if it's fixed or not, I'm going to close this. If the problem still exists in your application, please open a new issue and follow the instructions in the issue template that include info on how to create a reproduction using our template. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a...
Current behavior
Very similar setup to #14081, but instead of using
RouterUpgradeInitializer
(which doesn't work) you can manually invokesetUpLocationSync()
directly afterUpgradeModule#bootstrap
. This correctly sets up the location-syncing, but does not pickup the initial state because the initial$locationChangeStart
event from AngualrJS has already fired during theUpgradeModule#bootstrap
.Manually invoking
Router.navigateByUrl
an extra time aftersetUpLocationSync()
fixes it.Currently I've replaced
setUpLocationSync
with a modified version:Expected behavior
Loading an Angular route on initial page load should work
Minimal reproduction of the problem with instructions
#14081 except invoke
setUpLocationSync(this.upgrade);
directly after theUpgradeModule#bootstrap
call and dropRouterUpgradeInitializer
The text was updated successfully, but these errors were encountered: