2014-04-08 27 views
1

我正在使用AngularJS v1.2.15和angular-ui/ui-select。我的選擇HTML是:angularUI select下拉菜單僅在輸入字符後才顯示數據

<div class="form-group col-md-3"> 
    <div class="input-group select2-bootstrap-append"> 

     <ui-select ng-model="modelOwner.selected" theme="select2" class="form-control"> 
     <match placeholder="Select Owner">{{$select.selected.name}}</match> 
     <choices repeat="item in owner | filter: $select.search"> 
      <span ng-bind-html="item.name | highlight: $select.search"></span> 
     </choices> 
     </ui-select> 

     <span class="input-group-btn"> 
     <button ng-click="modelOwner.selected = undefined" class="btn btn-danger"> 
      <span class="glyphicon glyphicon-trash"></span> 
     </button> 
     </span> 

    </div>  
    </div> 

我的控制器調用:

$scope.modelOwner = {}; 

OwnersFactory.query({}, function (data) { 
    $scope.owner = data; 
}); 

我的服務代碼:現在

bootstrapApp.factory('OwnersFactory', function ($http,$state,serviceUrl,$resource,$log) { 

    return $resource(serviceUrl + 'owner/:id', {}, { 
     show: { method: 'GET', params: {}, isArray: false } 
    }) 
}); 

,在我的形式,我只能進入在後查看值至少一個字符。我想通過點擊下拉列表(而不是輸入任何字符)來顯示這個選擇下拉列表的值。

可能的解決方案:如果我只能在所有的AJAX調用完成後才加載我的狀態。

請幫我看看這裏。

+0

我之前力解決有一個用戶界面選擇相應的代碼,包括...因此是廣義的角度標籤 – spyderReloaded

回答