【发布时间】:2016-02-23 12:54:12
【问题描述】:
我从下拉列表中选择了两个值。我做了一个console.log,我可以看到下面的结果
>[Object,Object]
after expanding above output
>0: Object
id:"USA"
>__proto__:Object (all unnecessary information here)
>1: Object
id:"Russia"
>__proto__:Object (again all unnecessary information)
length:2
>__proto__:Array[0]
如您所见,当我从下拉列表中选择 2 个选项时,输出中会显示 2 个对象。 id 是在下拉列表中选择的值。
我只想从整个对象数组中获取此 Id 值并将其获取到单个数组中。我怎样才能通过这个输出并得到想要的结果?
参考这个多选下拉列表http://dotansimha.github.io/angularjs-dropdown-multiselect/#/
【问题讨论】:
标签: jquery angularjs object foreach