module.run() and $state.go() angularJS

后端 未结 7 2248
猫巷女王i
猫巷女王i 2021-02-12 12:38

I might have some kind of missunderstanding. Im using angular ui router and i have the next issue:

I have the next State provider:

angular
.module(\'Main         


        
7条回答
  •  情歌与酒
    2021-02-12 12:54

    Just point that following the advises of this thread, you can also solve it changing the otherwise block for this:

      $urlRouterProvider.otherwise(function ($injector, $location) {
        var $state = $injector.get("$state");
        $state.go("/");
      });
    

    Hope it helps

提交回复
热议问题