Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

API for adding the parameters to the URL #418

Open
mc-suchecki opened this issue May 24, 2016 · 1 comment
Open

API for adding the parameters to the URL #418

mc-suchecki opened this issue May 24, 2016 · 1 comment

Comments

@mc-suchecki
Copy link

In my application I am using one component for different URLs. Nevertheless, I want to force Angular to create new component on route change like this:

public $routerCanReuse(): boolean { return false; }

This is working fine. However, in one place in the component code, I need to put some parameters to the URL without reloading the page or navigating to a different one. I have tried to do the following:

this.$rootRouter.navigate(['/Component', this.parameters]);

This results in updated parameters in the URL (which is desired and expected), but also reloads the page (which is causing the create a new instance of the component, which is not desired). That raises my question - does Component Router provide an API for just updating the URL parameters, without actually invoking the routing? I did not find anything in the documentation. Thank you very much in advance.

@gleb-sevruk
Copy link

Any updates on this?

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