-
Notifications
You must be signed in to change notification settings - Fork 649
Onchange update the Schema not working #428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
So you've hit this bug: #395 Try doing an angular copy of the form definition whenever you update the schema, something like: $scope.testOnchange = function() {
console.log('came here');
$scope.schema.properties.profileDetails.properties.address.properties.
addressDetails.items.properties.addressFormat = ['dym', 'dym1'];
$scop.form = angular.copy($scope.originalForm);
$scope.$broadcast('schemaFormRedraw');
};
$scope.schema = {
"type": "object",
"title": "Comment",
"properties": {
"profileDetails": {
"type": "object",
"properties": {
"address": {
"type": "object",
"properties": {
"addressDetails": {
"title": "Contact Person",
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"addressType": {
"title": "Contact Type",
"description": "Select",
"type": "string",
"default": "test",
"enum": ["test", "test1"]
},
"addressFormat": {
"title": "Address Format",
"description": "Select",
"type": "string",
"default": "test",
"enum": []
}
}
}
}
}
}
}
}
}
};
$scope.originalForm = [{
"key": "profileDetails.address.addressDetails",
"title": "The array",
"type": "array",
"items": [{
"key": "profileDetails.address.addressDetails[].addressType",
"onChange": "testOnchange()"
}, {
"key": "profileDetails.address.addressDetails[].addressFormat",
}
]
}, {
"type": "submit",
"style": "btn-info",
"title": "OK"
}
];
$scop.form = angular.copy($scope.originalForm); |
@davidlgj below error I am getting after Copy $scop.form = angular.copy($scope.originalForm); Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting! |
@senthilsendhil There is typo |
Please re-open if you do not feel the question has been answered sufficiently. |
I like to update my schema after Form loader through onChange,
but schema not getting updated, Please refer the below controller code.
The text was updated successfully, but these errors were encountered: