2015-06-18 74 views
0

我已经定义了一个UI路由器路线如下添加查询字符串UI路由器的路由

 $stateProvider 
     .state('search', { 
      url: '/search', 
      abstract: true, 
      parent: 'loggedIn', 
      views: { 

       wrapper: { 
        controller: 'MyCtrl', 
        controllerAs: 'myCtrl', 
        templateUrl: '/scripts/views/search/views/search.wrapper.html' 
       } 
      } 
     }) 
     .state('search.subs', { 
      url: '', 
      resolve: { 
       isLoggedIn: isLoggedIn 
      }, 
      views: { 
       body: { 
        controller: 'SearchBodyCtrl', 
        controllerAs: 'searchBodyCtrl', 
        templateUrl: '/scripts/views/search/views/search.body.html' 
       } 
      } 
     }); 

不管怎样的问题是,这样的URL看起来像/search?hello=world我使用$state.transitionTo('search.subs', {hello: 'world'})试过,我不能生成一个查询参数但那不起作用。我想我传递的任何参数都不匹配,只会放在查询字符串中,但事实并非如此。

回答