2017-12-13 14 views
0

私はドロップダウンしているように見える問題があり、適切な選択を選択するたびにデータが表示されません。選択肢には2つの選択肢があります。Drop Down Angular Jsに特定のデータを表示できません

CSHTML

<ui-select ng-model="ctrl.requestType" theme="selectize" title="Choose type of requisition" style="min-width: 140px;"> 

    <ui-select-match placeholder="Select type of requisition"> 
    <span ng-bind="$select.selected.name"></span> 
    </ui-select-match> 

    <ui-select-choices repeat="existingRequestType.name as existingRequestType in ctrl.existingRequestTypes | filter: $select.search"> 

    <span ng-bind-html="existingRequestType.name| highlight: $select.search"> - 
     </span> 
    </ui-select-choices> 
</ui-select> 

Angular.JS形式のヘルプは

app.controller('myCtrl', function($scope, $http, $timeout, $interval) { 
     vm.existingRequestTypes = [{ 
      name: 'Purchase' 
     }, 
     { 
      name: 'Lease' 
     } 
     ]; 
    } 

ありがとう!

答えて

0

私はあなたが定義することを忘れてはかなり確信してvm

app.controller('myCtrl', function($scope, $http, $timeout, $interval) { 
    var vm = this; 

    vm.existingRequestTypes = [{ 
     name: 'Purchase' 
    }, 
    { 
     name: 'Lease' 
    } 
    ]; 
} 

OR

app.controller('myCtrl', function($scope, $http, $timeout, $interval) { 
    $scope.existingRequestTypes = [{ 
     name: 'Purchase' 
    }, 
    { 
     name: 'Lease' 
    } 
    ]; 
} 
関連する問題