How to capture URLs with arbitrary number of slashes in angular.js?

前端 未结 1 510
一个人的身影
一个人的身影 2021-01-18 07:23

I want to make an angular site dealing with files where users can navigate around in a file system tree, (like on github: github.com/angular/angular.js/tree/master/pat

相关标签:
1条回答
  • 2021-01-18 07:46

    As of Angular 1.1.5 you can use *path - see here.

    path can contain named groups starting with a star (*name). All characters are eagerly stored in
    $routeParams under the given name when the route matches.

    For example, routes like /color/:color/largecode/*largecode/edit will match /color/brown/largecode/code/with/slashs/edit

    As of Angular 1.3, the syntax is :path* (credit to DRAX in the comments)

    0 讨论(0)
提交回复
热议问题