0

Wie kann ich die Einstellungsoptionen für das ng-Dropdown-Multiselect dynamisch einstellen, wie das Einstellen der Daten, ist das möglich?Dynamisch die Einstellungsoptionen für das ng-Dropdown-Multiselect einstellen

bestellen hier aus: http://plnkr.co/edit/ntVBcGRsD0HXgQoshBlp?p=preview

Ansicht

<div ng-dropdown-multiselect="" 
    options="example65data" 
    selected-model="example65model" 
    extra-settings="example65settings"></div> 

Controller

$scope.example65model = [{id: 1}]; 
    $scope.example65data = [{id: 1, label: "David"}, {id: 2, label: "Jhon"}]; 
    $scope.example65settings = {selectionLimit: 3}; 

    $scope.updateMultiSelectLimit = function(){ 
     $scope.example65settings = {selectionLimit: 2}; 
    } 
    $scope.updateData = function(){ 
    $scope.example65data = [{id: 1, label: "Peter"}, {id: 2, label: "Yiss"}, {id: 3, label: "Max"}]; 
    } 

Antwort

0
//HTML 
<div ng-dropdown-multiselect="example65data" id="xyz"//Can Be Anything options="example65data" selected-model="example65model"></div> 

//JS 
$scope.example65model= []; 
function abc//Can Be Anything() { 
    var allData = hrmsService.getdata//Service Function Call(); 
    allData.then(function (//Take any variable//pqr) { 
     DataObj = []; 
     for (var i in pqr.data) { 
      item = {} 
      item["id"] = pqr.data[i].Id//Primary Key; 
      item["label"] = apiSkills.data[i].Description//Any Description Field; 
      DataObj.push(item); 
     } 
     $scope.example65data= DataObj; 
    }, function() { 
     alert("Data Not Found"); 
    }); 
} 
Verwandte Themen