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

后端 未结 7 2238
猫巷女王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 13:09

    $state.go does not work in the run, it isn't initialized yet so! What I did was throw the logic in a service, add a controller to the module you have the run in, run it in the controller! That should work.

提交回复
热议问题