AngularJS ui-router otherwise to state instead of url?

后端 未结 3 1631
傲寒
傲寒 2021-02-14 04:26

I am using AngularJS and ui-router and in my app.js. I have the following line:

$urlRouterProvider.otherwise(\'/\');

However

3条回答
  •  -上瘾入骨i
    2021-02-14 04:30

    Try This.

    $urlRouterProvider.otherwise(function($injector, $location){
        $injector.get('$state').go('404');
    });
    

提交回复
热议问题