If I've got a route that looks like this:
{ path: 'my-component/:foo/:bar', component: MyComponent }
Is it possible to create a link that just updates one portion of that URL from within MyComponent
? For example, instead of:
goToNextBar() {
this.router.navigate(['/my-component/', this.foo, this.bar + 1]);
}
I'd like to use something like:
goToNextBar() {
this.router.navigateToRelativeLink({ bar: this.bar + 1 });
}
ie, letting the component update just one portion of the URL without having to be aware of the rest.