ng-select with an object and its properties in angularjs

前端 未结 1 401
粉色の甜心
粉色の甜心 2021-02-02 17:26

I have been trying to figure out how to use an array if objects as the key values for an ng-select directive

this is the data I want to use

$scope.selec         


        
1条回答
  •  孤独总比滥情好
    2021-02-02 17:50

    ng-options supports both array and object based data source. For example:

    Array based data source:

    $scope.options = ["Blue", "Red", "Yellow"]
    
    
    

    However, you are using an incompatible data structure for the array based option. You can use like this:

    
    

    The plnkr is updated also.

    0 讨论(0)
提交回复
热议问题