Issue
I have the following code
<select ng-model="someObj.SomeEligibleStatusId" ng-options="st.someId as st.someDescription for st in someFunctionThatGeneratesData()"></select>
where someFunctionThatGeneratesData(param1, param2, param3)
returns an array of objects such as
[
{
"someId":1,
"someDescription":"Test 1"
},
{
"someId":2,
"someDescription":"Test 2"
}
]
and I'm trying to change the selected option in javascript as
someObj.SomeEligibleStatusId = 1
without luck. I try also to add "track by", bind it to an object item of the array, and a couple of more scenarios... I'm losing it here guys. Can someone please help me out?
Solution
$scope.selectedsomeId = $someFunctionThatGeneratesData.options[1];
<select data-ng-model="selectedsomeId"
ng-options="st.someId as st.someDescription for st in someFunctionThatGeneratesData()"></select>
Answered By - Thomson Mixab
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.