ui-router icon indicating copy to clipboard operation
ui-router copied to clipboard

Rewrite location with default parameter resolved

Open sveilleux opened this issue 13 years ago • 2 comments

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/

Am I using a wrong approch?

Thanks

sveilleux avatar Oct 29 '13 15:10 sveilleux

Unfortunately we don't use the issue tracker as a help forum (at least we are trying not to). You'll have more luck posting your question to stackoverflow with the proper tags. See the Get Help link in the readme.

http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router

timkindberg avatar Oct 29 '13 19:10 timkindberg

Yeah I already did it months ago without any answers. http://stackoverflow.com/questions/18319017/angularjs-ui-router-rewrite-location-with-default-parameter-resolved

Sadly...

Maybe some of you can help me out by giving an answer? Thanks a lot

sveilleux avatar Oct 29 '13 19:10 sveilleux