제 편집 페이지에서 필요한 것은 json 파일에서 값이 오는 값을 드롭 다운 목록에 표시하는 것입니다. html 파일에서 값을 가져올 수 있지만이 값을 선택한 것으로 표시하는 데 어려움이 있습니다.anglejs 드롭 다운 목록에서 json에서 오는 값을 설정하는 방법
<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 파일 :
{
"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"
}
}
나는 유사한 문제 (How do I set default value of select box in angularjs)를 보았다하지만 힘이 나를 위해 일
다음은 HTML 코드입니다.
어떤 도움이 큰 도움이 될 것입니다.
을하고있다 방법을 여기에
다음에 그것을 할 수 있습니다. 제조업체에서 제조사의''ng-options = "manufacturer.manufacture_id를 시도하십시오."'' –
ng 반복을 할 때 왜 값을 지키고 있는지 확인한 후 값을 확인한 다음 확인하십시오. – Rohan