我有以下代码:
<select ng-model="model.RemediationCredentials" name="remediationCredential" id="remediationCredential">
<option value="0">---</option>
<option ng:repeat="cred in credentialsList"
data-index="{{$index}}" value="{{cred.Value}}">{{cred.Key}}</option>
</select>
看起来credentialsList
像:
credentialsList = [ { Key: "Panda", Value: "Zoo: } ]
我想我需要使用ng-repeat
vsng-option
来做一些基本的事情,比如没有选择和做data-index
. 但是,当我尝试设置模型时它不起作用......
$scope.model.RemediationCredentials = "Zoo"
有什么建议么?