我只想在控制器中使用代码来选择Angular Schema Form中的选项。
我在 HTML 标记中有以下内容:
<div sf-schema=schema sf-form=form sf-model=formData></div>
现在,我想在控制器中执行此操作:
//controller.js
//This is not working
$scope.formData.select_1 = 4;
$scope.formData.select_2 = 3;
//Schema for the form
$scope.schema =
"select_1": {
"type": "string",
"enum": ["1", "2", "3", "4", "5", "6"]
},
"select_2": {
"type": "string",
"enum": ["1", "2", "3", "4", "5", "6"]
}
$scope.form = //All the form properties here