Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
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

Description

@gsklee

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.

Activity

  1. btford commented on Dec 9, 2013

    @btford
    Contributor

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

  2. gsklee commented on Dec 10, 2013

    @gsklee
    ContributorAuthor

    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 😉

  3. btford commented on Dec 10, 2013

    @btford
    Contributor

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

  4. btford commented on Feb 4, 2014

    @btford
    Contributor

    Duplicate of #738 (continue discussion there please!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions