2016-06-09 90 views
0

目前我正在使用select作爲下拉菜單。我想將此更改爲多選下拉菜單。但是當我宣佈多選下拉菜單時,我收到錯誤消息,說「未知屬性選項」多選下拉式AngularJS - 選項屬性未知

當前代碼只是沒有多選的下拉菜單。

     <select class="form-control">  <option ng-repeat="item in CETIGroupList" value="{{item}}">{{item}}</option> 
         </select> 

我寫的爲多選是

<div ng-dropdown-multiselect="" options="CETIGroupList" ></div> 

請幫我創建一個多選下拉列表。 謝謝

回答

0

包括loadsh.js,bootstrap cssAngularJS Dropdown Multiselect在您的應用程序中。注入angularjs-dropdown-multiselect在您的應用程序

angular.module('sampleApp', ['angularjs-dropdown-multiselect']) 

在HTML頁面中

<div ng-dropdown-multiselect="" options="example13data" selected-model="example13model" ></div> 

在控制器

$scope.example13model = []; 
    $scope.example13data = [{ 
     id: 1, 
     label: "David" 
    }, { 
     id: 2, 
     label: "Jhon" 
    }, { 
     id: 3, 
     label: "Lisa" 
    }, { 
     id: 4, 
     label: "Nicole" 
    }, { 
     id: 5, 
     label: "Danny" 
    }]; 

看看這個小提琴:https://jsfiddle.net/ebinmanuval/8Ltae8pb/