获取与标签相同的下拉值

时间:2017-05-29 09:12:58

标签: javascript angularjs

下拉以从json文件中获取选项。我得到了选项,但下拉列表的值显示如下。我的问题是如何获得该值与标签相同,即。,value =“4.90a-ea02”label =“4.90a-ea02”

<select name="version" class="form-control" ng-model="myObj.Version" ng-options="item as item.version for item in contver| unique:'version'|orderBy: '-version'" >

enter image description here

2 个答案:

答案 0 :(得分:1)

cron

答案 1 :(得分:0)

只需将ng-options="item as item.version for更改为ng-options="item.version as item.version for

即可
<select name="version" class="form-control" ng-model="myObj.Version" 
                  ng-options="item.version as item.version for item in contver| unique:'version'|orderBy: '-version'" >