angular-ui: ui-router dynamic routes and states
angular-ui, angular-ui-router, angularjs, javascript, requirejs
Solution
Turn's out I'm an idiot: When I switched from ngRouter to ui.router, I forgot to switch `ng-view` to `ui-view`. Working plunkr: http://plnkr.co/edit/ZckIBlayuB10hooJ0sY5
Problem
I have a dynamic route defined as: ``` $urlRouterProvider .when( '/:resource?collection&type&id', [ '$match', '$stateParams', function routeValidator( $match , $stateParams ) { var path = ''; angular.forEach($match, function joinner( val , key ) { if ( angular.isDefined(val) ) path += '/' + val; }); return path; } ] ) .when( '' , '/about' ) .when( '/' , '/about' ) .otherwise( '/404' ); ``` And then several states: ``` $stateProvider .state('about', { "url": "/about", "templateUrl": "about.tmpl" } ) //… ``` I try hitting `index.html#/` or `index.html#/about`, and none of my states are getting invoked (and subsequently none of my controllers). BUT my routes are obeyed (ex '' gets redirected to '/about'). No console errors and values return as expected (ex. for `index.html#/about`, $match & path = `/about`). Edit It seems Require is part of the issue: - Here it's working in jsfiddle without require. - Here it's not working in plunker with require.