我有一個可以編輯的模式。但在我的模式中,我無法預先選擇。角預選
這是我的HTML
<select ng-model='names.productionType' ng-options="data for data in productionType"></select>
這是我的腳本
$scope.productionType =[
"Article LP Composition",
"Normal LP Composition",
"Reading Material",
"Transcribed Manuscript",
"LP Production"
];
到目前爲止,這是我試過
HTML
<select ng-model='editable.productionType' ng-options="data for data in productionType" ng-selected="editable.productionType='{{names.production_type}}'"></select>
在我的劇本
$scope.names.productionType = "Normal LP Composition";
它會預先選定的,但問題是我不能選擇其他選項
你'NG-選擇= 「editable.productionType = '{{names.production_type}}'」'不應該有括號。你可以刪除整個'ng-selected',因爲angular會發現你的'ng-model'等於其中一個選項,然後選擇它。看到[這個jsfiddle](https://jsfiddle.net/b6cu3u8s/) – devqon
@devqon但是當我改變預先選擇提交時,它不會給我提交模態的新值。 –