angular/angular.js — pull request #3602 by thenikso (2013-08-15 09:40:22+00:00)
Title: fix(routeProvider): route matcher should fill non-optional parameters or fail

Already requested in #3481, this PR aims to correct the currently behavior of a `$routeProvider` configured like so:

```
$routeProvider
.when('/pages/:page/*comment', {template: 'comment'})
.when('/pages/:page', {template: 'page'})
.when('/pages', {template: 'index'});
```

Would never reach any of the 'page' or 'index' routes unless they are defined in reverse order. Given that ordering of route matching is not guaranteed to be the same as the definition of `when`s, a fix could be the one in this PR.

With this PR, a route containing parameters __must__ be able to give a value to all parameters to match.

:bangbang: This creates _breaking change_ where locations like `/page/` will __not__ match the route `/page/:id`.

@joshrtay @jbdeboer