title: A parameter of ui-router in controller and resolve
body: <p>I have configured the following ui-router. </p>
  
  <pre><code>app.config(['$stateProvider', function ($stateProvider) {
      $stateProvider
          .state('global.editor', {
              url: '/posts/editor/{id}',
              templateUrl: '/htmls/editor.html',
              controller: 'EditorCtrl',
              resolve: {
                  post: ['$stateParams', 'codeService', function ($stateParams, codeService) {
                      return codeService.getPost($stateParams.id)
                  }]
              }
          }
          .state('global.new', {
              url: '/new',
              templateUrl: '/htmls/editor.html',
              controller: 'EditorCtrl'
          })
          .state('global.newTRUE', {
              url: '/newTRUE',
              templateUrl: '/htmls/editor.html',
              controller: 'EditorCtrl'
          })           
          .state('global.editor.panels', {
              controller: 'PanelsCtrl',
              params: { layout: 'horizontal' },
              templateUrl: function (params) { return "/htmls/" + params.layout + '.html' }
          }
  }])
  
  app.controller('EditorCtrl', ['$scope', '$state', function ($scope, $state) {
      $scope.layout = "horizontal";
      $scope.$watch('layout', function () {
          $state.go('global.editor.panels', { layout: $scope.layout });
      });
  }]);
  </code></pre>
  
  <p>As a result, <a href="https://localhost:3000/#/new" rel="nofollow noreferrer">https://localhost:3000/#/new</a> in a browser leads to (the state <code>global.editor</code>, then to) the state <code>global.editor.panels</code>.</p>
  
  <p>Now, I want to add a parameter <code>connected</code>:</p>
  
  <ol>
  <li>I don't want it to be shown in the url</li>
  <li><a href="https://localhost:3000/#/new" rel="nofollow noreferrer">https://localhost:3000/#/new</a> in a browser makes <code>connected</code> to be <code>false</code>, and <a href="https://localhost:3000/#/newTRUE" rel="nofollow noreferrer">https://localhost:3000/#/newTRUE</a> in a browser makes <code>connected</code> to be <code>true</code></li>
  <li><code>connected</code> can be past into the controller <code>EditorCtrl</code> and <code>PanelsCtrl</code></li>
  <li><code>connected</code> can be available in the <code>resolve</code> of <code>global.editor</code>; ideally, we could resolve different objects according to the value of <code>connected</code>.</li>
  </ol>
  
  <p>Does anyone know how to accomplish this?</p>