Closing a modal instance causes router to route to default state

时间:2018-04-18 17:55:53

标签: angular angular-ui-router angular-ui-bootstrap

I am using a urlRouterProvider for a default route on initial page loadup.

$urlRouterProvider.otherwise('/state1/welcome');

I have 2 state that loads different HTML pages. On the second state, I have a button that opens a modal and on the modal a cancel button that closes the modal.

$scope.modalInstance.dismiss("Cancel");

For some reason, calling this method will change my state from /state2/welcome to /start/welcome (The default). Why is it doing this and how do I prevent it from changing my state? I still need to keep the urlRouterProvider, but commenting that out seems to keep the state the same after closing the modal.

0 个答案:

没有答案