我有几个不同的路由,但包含类似的参数.
例:
when '/user/:accountId/charts/:chartType', controller:ChartsController
when '/manager/:accountId/charts/:chartType', controller:ChartsController
when '/whatever/pathy/paththingy/charts/:chartType', controller:ChartsController
Run Code Online (Sandbox Code Playgroud)
请注意,所有三个视图都使用相同的图表控制器来控制视图.它是一个相当通用的控制器,但它需要在可用的图表类型之间切换...同时保持其余的路线.
示例:(这不起作用)
if my currrent url is '/user/001/charts/comparison'
Then I call something like:
$route.current.params.chartType = 'newChart';
$route.reload(); // or soemthing similar?
I want the url to become '/user/001/charts/newChart'
Run Code Online (Sandbox Code Playgroud)
有没有人知道如何在不完全重新键入或重建路径路径的情况下轻松更新路径参数?