I have this route
You can define your own type of parameter.
var GUID_REGEXP = /^[a-f\d]{8}-([a-f\d]{4}-){3}[a-f\d]{12}$/i;
$urlMatcherFactoryProvider.type('guid', {
encode: angular.identity,
decode: angular.identity,
is: function(item) {
return GUID_REGEXP.test(item);
}
});
Here is a showcase on plunker with this solution
Then specify this type in url route expression:
.state('mystate', {
url: '/{id?guid}',
templateUrl: '/views/partial.html'
});
You can read more on that page in docs