I have a route /a
with some parameters (such as /a;foo=1;bar=2/
) and two sub-routes: /a/x
and a/y
.
Component responsible for route a
fiddles with parameters foo
and bar
and changes them depending on the user input. It also updates the parameters in the route, as shown above.
Can I update route parameters without changing sub-routes (or manually having to read them and re-apply them)?
This is how I navigate through code, if I know the sub-route (x
or y
):
this.router.navigate(['/a', params, 'x']);
// or
this.router.navigate(['/a', params, 'y']);
I hope for a method along the lines of the following:
this.router.navigate(['/a', params, /* don't change */])
If I completely leave out the last element of the array (x
/y
), it just always gets redirected to x
since that's the default route.
Versions: core 2.0.0-rc.5 and router 3.0.0-rc.1