Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Publicize route template parsing API in ngResource #3288

Closed
gsklee opened this issue Jul 20, 2013 · 4 comments
Closed

Publicize route template parsing API in ngResource #3288

gsklee opened this issue Jul 20, 2013 · 4 comments

Comments

@gsklee
Copy link
Contributor

gsklee commented Jul 20, 2013

I've encountered several use cases where I need to parse route templates (eg. /items/:category/:sortBy/:categoryId) using info from $routeParams; a prominent use case is when implementing a custom cache to store backend response plus some corresponding additional information, it will be an array with the parsed route template acting as the key/index of the array.

For the time being I'm doing the parsing by copy-pasting related codes (https://github.com/angular/angular.js/blob/master/src/ngResource/resource.js#L340) into my own projects, but that is overly redundant; if an official API can be created, it would be really great.

@btford
Copy link
Contributor

btford commented Dec 9, 2013

It should be easy enough to pull this out into its own service. The only difficult part is what to call the service.

@gsklee
Copy link
Contributor Author

gsklee commented Dec 10, 2013

If you can find an awesome name for me I can send in a PR... or I'll just make up one like say $parseRoute or $parseThisRouteTemplateThingie 😉

@btford
Copy link
Contributor

btford commented Dec 10, 2013

You can always change the name later. I'd make a PR first and we can discuss the name afterwards. :)

@btford
Copy link
Contributor

btford commented Feb 4, 2014

Duplicate of #738 (continue discussion there please!)

@btford btford closed this as completed Feb 4, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants