I have a url such as this: http://foo.bar/#/some/other/path
How do I capture "some/other/path" as a route parameter?
I tried this:
var App = angular.module("App", [])
.config(function($routeProvider){
$routeProvider
.when('/:path', { controller: ListCtrl, templateUrl: 'list.html'})
.otherwise({ redirectTo: '/'})
});
But :path is only giving me some rather than some/other/path
As mentioned by Stewie in the comment above, Angular unstable 1.1.3 now supports catch-all by using an asterisk.
For example:
var App = angular.module("App", [])
.config(function($routeProvider){
$routeProvider
.when('/*path', { controller: ListCtrl, templateUrl: 'list.html'})
.otherwise({ redirectTo: '/'})
});
Partial string matches—-such as matching for instances of jpg in a url—-still don't seem supported.