如果我有一个数组
$scope.colors = [
{name:'black', shade:'dark'},
{name:'white', shade:'light'},
{name:'red', shade:'dark'},
{name:'red', shade:'dark'},
{name:'yellow', shade:'light'}
];
是否可以使用 ng-options 构建一个在下拉列表中仅包含唯一值的选择元素,这样红色只会显示一次?
最佳答案
关于angularjs - angular.js 使用 ng-options 仅显示唯一值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14748440/