title: module.run() and $state.go() angularJS
body: <p>I might have some kind of missunderstanding. Im using angular ui router and i have the next issue:</p>
  
  <p>I have the next State provider:</p>
  
  <pre><code>angular
  .module('MainApp')
  .config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider ) {
      $stateProvider
          .state('register', {
              url: "/",
              abstact: true,
              views: {
                  "side-bar": {
                      controller: "GetSideBarCtrl"
                  },
                  "page-body@register": {
                      templateUrl: "/App/Views/WelcomePage.html"
                  }
              },
          })
          .state('register.Register', {
              url: "Register",
              views: {
                  "page-body": {
                      controller: "RegisterCtrl",
                      templateUrl: "/App/Views/Register.html"
                  }
              },
          })
          .state('register.Login', {
              url: "Login",
              views: {
                  "page-body": {
                      controller: "LoginCtrl",
                      templateUrl: "/App/Views/Login.html"
                  }
              },
          })
          //For registered and loged in users!
      /* */
          .state('main', {
              url: "/:userId",
             // abstact: true,
              views: {
                  "side-bar": {
                      controller: "GetSideBarCtrl"
                  },
                  "page-body@main": {
                    //  controller: "LoginCtrl",
                      templateUrl: "/App/Views/MainPage.html"
                  }
              },
          });
      $urlRouterProvider.otherwise('/');
  }]);
  </code></pre>
  
  <p>And run function</p>
  
  <pre><code>angular
  .module('MainApp')
  .run(['$rootScope', '$state', '$cookieStore', 'principal',
  function ($rootScope, $state, $cookieStore, principal) {
      var cookies = $cookieStore.get('user');
      if (cookies) {
          principal.Authenticate(cookies.split(' ')[0], cookies.split(' ')[1]);
          $state.go('main', { userId: cookies.split(' ')[0] });
      } else {
          $state.go('register.Login');
      }
  }]);
  </code></pre>
  
  <p>Everything works fine, when cookies are present and authenication works without any problems but $state.go does nothing, i cant figure out why, can you please help and explain me...</p>