angular-ui / ui-router

The de-facto solution to flexible routing with nested views in AngularJS
http://ui-router.github.io/
MIT License
13.54k stars 3k forks source link

urlMatcherFactory special types don't work. #1222

Closed tiwatson closed 9 years ago

tiwatson commented 10 years ago

Wasn't sure how to create a plunker using the master.

The following does not work as urlMatcherFactory's $get method is what activates the new UrlMatchers. $get does not get called when injected into a config block. injecting via a run block comes too late.

angular.module('rkmpp', ['ui.router'])
.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) {
  $stateProvider.state('numbers', { url: '/{id:int}', controller: function() { console.log('passed'); } });
}]);

https://github.com/angular-ui/ui-router/blob/master/src/urlMatcherFactory.js#L694

eddiemonge commented 9 years ago

https://gist.github.com/eddiemonge/f6a58169c2846731a1eb