angular/angular.js — pull request #972 by petrovalex (2012-05-20 19:48:03+00:00)
Title: feat($route): regexp support for $route params

Commit related to the issue #918

- regex for the route is constructed once and then reused

- allows provide regex expressions for params in the constraints object:
$routeProvider.when('/user/:id/:age', {template:'user.html'}, {id:"[0-9]*", age:"[0-9]*"})

- list of values is supported using regular expression:
$routeProvider.when('/some/:param', {template:'foo.html'}, {param:"one|two|tree"});

- supports predefined types for paramsters (int, float, bool, string):
$routeProvider.when('/some/:param', {template:'foo.html'}, {param:"float"});
$routeParams.param will be typeof number

- predefined types can be extended, bu extending $routeProvider.shortcut object