angular / router

The Angular 1 Component Router
MIT License
665 stars 135 forks source link

API for adding the parameters to the URL #418

Open mc-suchecki opened 8 years ago

mc-suchecki commented 8 years ago

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 commented 7 years ago

Any updates on this?