title: Angular UI-Router passing data between states with go function does not work
body: <p>I just started learning angularjs and I am using angular-ui-router. I am trying to send data from one state to another using <code>$state.go</code> but I have no success. Here is what I have so far:</p>
  
  <p><em>I have not included the html intentionally because I assumed it was not needed if it is needed please tell me and I will add it.</em></p>
  
  <p>I have configured my states as below:</p>
  
  <pre><code>  $stateProvider
          .state('public', {
              abstract: true,
              templateUrl: 'App/scripts/main/views/PublicContentParent.html'
          })
          .state('public.login', {
              url: '/login',
              templateUrl: 'App/scripts/login/views/login.html',
              controller: 'loginCtrl'
          })
  
      $stateProvider
          .state('private', {
              abstract: true,
              templateUrl: 'App/scripts/main/views/PrivateContentParent.html'
          })
          .state('private.visits', {
              url: '/visits',
              views: {
                  'main': {
                      controller: 'visitsListCtrl',
                      templateUrl: 'App/scripts/visits/views/VisitsList.html'
                  }
              }
          });
  </code></pre>
  
  <p>When my <code>LoginController</code> is invoked it will execute  the below code:</p>
  
  <pre><code>loginModule.controller('loginCtrl', ['$state', function ($scope, $state) {
  
      $state.go('private.visits', { name : "Object"});
  
  }]);
  </code></pre>
  
  <p>When the <code>private.visits</code> page is active, I am trying to print the <code>$stateParams</code>:</p>
  
  <pre><code>visitsModule.controller('visitsListCtrl', ['$stateParams',
      function ($stateParams) {
  
          console.log($stateParams);
  
  
      }]);
  </code></pre>
  
  <p>As things state $stateParams is an empty object. I expected it to to contain the object I passed in loginCtrl.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>It seems that if <code>private.visits</code> url has this url format <code>'/visits/:name'</code> and I also add the property params: ["name"] I get access to the object I send from the <code>public.login</code> state.
  The side  effect is that the parameters are added to the url which is logical.</p>
  
  <p>I tried doing the same thing with a child state with no url, and in this case it seems that I do not have access to the params I passed from <code>public.login</code>.</p>
  
  <p>How do I send data in child states?</p>