In my edit page, what I need is to show the value in drop down list where the value is coming from a json file. I am able to get the value in html file but struggling in showing this value as selected.
Here's the html code:
<select class="form-control" name="manufacturer" ng-change="loadModels(cameraDetails.manufacture_id.id);" ng-model="cameraDetails.manufacture_id" ng-options="manufacturer.name for manufacturer in manufacturers" required>
<option value="">{{'PLEASE_SELECT' | translate}}</option>
</select>
{{cameraDetails.manufacture_id}} // Here I am getting the value.
json file:
{
"ip": "10.103.01.0",
"name": "Camera axiss",
"description": "Description text here",
"manufacture_id": "SONY",
"modelId": "Model XYZ001",
"user_name": "user",
"password": "pass",
"isEnableCamera": true,
"hasMasking": true,
"hasPresetCamera":true,
"userGroup": {
"userGroupIds": "Group 2"
}
}
I saw similar issue (How do I set default value of select box in angularjs) but that dint worked for me.
any help would be a great help.