Monday, 19 August 2013

Angularjs ui-router: Rewrite location with default parameter resolved

Angularjs ui-router: Rewrite location with default parameter resolved

I have multiple nested states. Let's say:
departments:
/departments/:idDepartment
departments.group:
/group/:idGroup
departments.group.category:
/category/:idCategory
Each state has a resolve to retrieve his data, prerequisites. BTW, I use
this workaround to use the parent states resolved data in the child states
resolve (https://gist.github.com/MattWalker/6106393)
When the user goes to /processes I redirect him to
/departments//group//category/ so he can see the default department with
the default group and default category. I don't want him to select a
department then a group then a category. I want to show him right away a
view with default values.
It works but here is my question. Once the default values have been found
and the view is shown, how can I have the url location display something
like
/departments/1/group/23/category/2
instead of
/departments//group//category/
Thanks

No comments:

Post a Comment