问题描述
1。我想绑定来自这个json数组的下拉列表以获取唯一的住所名称
$ scope.domicile = {};
$ scope.domicile .users = [
{DomicileName:'European',PortFolioName:'nternational Select x EM ADR',别名:'ADR x EM',百分比:1.0,Ticker:'ADR',类别:' ADRxEM',SortOrder:1},
{DomicileName:'European',PortFolioName:'International Select x EM ORD',别名:'Ord x EM',百分比:4,Ticker:'ORD' ,类别:'ADRxEM',SortOrder:1},
{DomicileName:'European',PortFolioName:'国际选择EM ADR',别名:'ADR w EM',百分比:4,Ticker :'ADR',类别:'ADRwEM',SortOrder:''},
{DomicileName:'开发市场非欧洲',PortFolioName:'国际选择x EM ADR',别名:'ADR x EM',百分比:4,股票代码:'ADR',类别:'ADRxEM',SortOrder:1}
];
我的尝试:
i已经根据我的知识尝试了很多,但无法找到解决方案。
1. I want to bind the dropdown from this json array for unique domicile name
$scope.domicile = {};
$scope.domicile.users = [
{ DomicileName: 'European', PortFolioName: 'nternational Select x EM ADR', Alias: 'ADR x EM', Percentage: 1.0, Ticker: 'ADR', Category: 'ADRxEM', SortOrder: 1 },
{ DomicileName: 'European', PortFolioName: 'International Select x EM ORD', Alias: 'Ord x EM', Percentage: 4, Ticker: 'ORD', Category: 'ADRxEM', SortOrder: 1 },
{ DomicileName: 'European', PortFolioName: 'International Select with EM ADR', Alias: 'ADR w EM', Percentage: 4, Ticker: 'ADR', Category: 'ADRwEM', SortOrder: '' },
{ DomicileName: 'Developed Market Non-European', PortFolioName: 'International Select x EM ADR', Alias: 'ADR x EM', Percentage: 4, Ticker: 'ADR', Category: 'ADRxEM', SortOrder: 1 }
];
What I have tried:
i have tried a lots of the this as per my knowledge but not able to find the solution.
推荐答案
<select ng-model="ddlUsers" ng-options="user.Alias for user in users track by user.Alias">
这篇关于在angularjs中从json的下拉列表中绑定唯一值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!