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

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -