I want to define any in url whit angular ui-router
in angular self router we can define a route like this:
$routeProvider.when('/:params*', {
template: 'test',
})
and when call this url
/a/b/c
it's work
how can do same in angular ui-router
For eager matching of URL parameters, use:
$stateProvider
.state('all', {
url: "/*params",
template: "test"
});
//OR
$stateProvider
.state('all', {
url: "/{params:.*}",
template: "test"
});
From the Docs:
URL Regex Parameters
Examples:
'/files/{path:.*}'- Matches any URL starting with '/files/' and captures the rest of the path into the parameter 'path'.'/files/*path'- Ditto. Special syntax for catch all.