Namburi Akhil
Namburi Akhil

Reputation: 29

get value of the dropdown same as label

Dropdown to get the options from json file. I'm getting the options but the value of the dropdown is shown as below.my question how to get the value is same as label ie., 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

Upvotes: 0

Views: 51

Answers (2)

Gobinath M
Gobinath M

Reputation: 2021

<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'" >

Upvotes: 1

Sachila Ranawaka
Sachila Ranawaka

Reputation: 41397

just change the ng-options="item as item.version for to 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'" >

Upvotes: 0

Related Questions