我正在尝试使用动态数据为组合框添加值。问题是这个值没有显示在我选择的组合框中。无法将值添加到组合框中的ng模型中
这里是我的html
<label>Veuillez choisir l'outil de référence :</label>
<select class="form-control"
ng-model="refouti"
ng-change="getversion()">
<option value="" selected>
Tous
</option>
<option ng-repeat="o in outills"
value={{o.id}}>
{{o.nomref}}
</option>
</select>
在我的控制器时,我想增加价值refouti
这样的:
$scope.refouti="OPCOM";
我得到这样的
谢谢到任何支持。
你想增加值作为默认值? –
不,它不是一个默认值我不想粘贴所有的代码,因为它会看起来更复杂''scope.refouti =动态值,在每个条件下改变'ps如果我想添加一个默认值,我会添加一个默认值选项与该值 –
我建议你在选择中使用ng-options而不是ng-repeat。 –