AngularJS catch-all route?
angularjs, routes
Solution
I think the best you can do with Angular is `*`, which is new as of v1.1.5 of $routeProvider:
`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/slashes/edit` and extract: - `color: brown` - `largecode: code/with/slashes`
You'd have to parse the `largecode` param yourself though.
Problem
I'm working on a file editing application in AngularJS. My urls look like this: #/fileName.md or #/folder/fileName.md or #/folder/nested-folder/another-folder/itgoesonforever/filename.MD I don't want to have to do a route for every single depth and it could be ~15 routes deep. Are there any ways to have conditional routes? Crudely: ``` /:fileorfolder?/:fileorfolder?/:fileorfolder?/:fileorfolder? ```