我在angularjs中有多个ui选择,但是当我尝试在模型中启动数据时,会抛出错误:
<ui-select multiple ng-model="control_access.antennas_select_input" theme="bootstrap" search-enabled="true"
reset-search-input="true" close-on-select="false">
<ui-select-match class="ui-select-match">{{$item.name}}</ui-select-match>
<ui-select-choices class="ui-select-choices" repeat="antennasInput in (antennasDataInput) track by $index">
{{antennasInput.name}}
</ui-select-choices>
</ui-select>
$scope.editForm = function () {
$scope.control_access.antennas_select_input = [<%= AntennaInstalled.all.to_json %>];
}
var action = $("#action_control_access").val();
if(action == "edit"){
$scope.editForm();
}
答案 0 :(得分:0)
尝试一下:
$scope.control_access = {};
$scope.editForm = function () {
$scope.control_access.antennas_select_input = [<%= AntennaInstalled.all.to_json %>];
}