javascript - Ui-router state with state parameter not recognized on page reload -


i have extremely strange situation ui-router. have state defined so:

.state('profilequestion', {         url: '/profile-questions/:profilequestionid',         templateurl: 'client/users/views/profile-question.ng.html',         controller: 'profilequestionctrl'  }) 

it works fine , dandy navigate through app. however, if go straight page, example localhost:3000/profile-questions/1, app not recognize page, , tries go otherwise route.

$urlrouterprovider.otherwise('/login'); 

what's more, goes /profile-questions/login instead of /login! controller profile-questions never gets called. in sum, ui router works fine when navigate page another, fails when load page itself. should add if remove state parameter options :profilequestionid, /profile-questions route loads correctly. ideas?

as @radim kohler , @joe lloyd suggested, issue html5 mode turned on. see server thinks looking in /profile-questions/ directory - doesn't exist. fix this, changed query string parameter so:

.state('profilequestion', {         url: '/profile-question?profilequestionid',         templateurl: 'client/users/views/profile-question.ng.html',         controller: 'profilequestionctrl'  }) 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -