Hi, the community has been stuck on this for a while ...
Scenario:
I have a drop-down list that I pre-populate with the values received from the service. Now the same object returned from the service allows me to find out the value that must be pre-selected for this drop-down list. The service returns a JSON object with all this information.
JSON Example Return from Service
{
"stepsInvolved": [{
"label": "Step 1",
"value": "Step 1"
}, {
"label": "Step 1",
"value": "Step 1"
}, {
"label": "Step 1",
"value": "Step 1"
}],
"valueSelected": {
"label": "Step 1",
"value": "Step 1"
}
}
Question
Using Angular I assign the values of a drop-down list from stepsInvolvedto a variable region $scope.options, which is pretty straight forward.
, "valueSelected" JSON? angular?
JSFiddles Plunkers .
P.S: ,
$scope.options= stepsInvolved;
$scope.selectedOption = $scope.options[1];