javascript - UI-router empty param causes navigation to wrong route -


this should simple can't figure out.

i have 2 routes:

$stateprovider      .state('users', {         url: '/users',         views: {'@': {             templateurl: 'templates/users.tpl.html',             controller: 'usersctrl users'         }}     })     .state('users.edit', {         url: '/{userid}',         views: {'@': {             templateurl: 'templates/edituser.tpl.html',             controller: 'edituserctrl edituser'         }}     }); 

this works fine if use ui-sref or $state.go navigate "users" state name, if type domain.com/users/ url bar goes edit state empty userid parameter though there nothing after trailing stash.

normally wouldn't problem firing edituser route no userid causes console errors pain fix.

is fixable?

take post:

https://github.com/angular-ui/ui-router/issues/50

and link referenced in post:

https://github.com/angular-ui/ui-router/wiki/frequently-asked-questions#how-to-make-a-trailing-slash-optional-for-all-routes


Comments

Popular posts from this blog

Multilayer CSV to filtered excel -

Listboxes in c# -

ios - Why must I define variables twice in the Header file? -