angular-schema-form

Focus on the first field that is .ng-invalid at Submit - not working for radios-inline

百般思念 提交于 2019-12-24 00:33:49
问题 I am using the directive from accepted answer on Set focus on first invalid input in AngularJs form to accomplish this: app.directive('accessibleForm', function () { return { restrict: 'A', link: function (scope, elem) { // set up event handler on the form element elem.on('submit', function () { console.log("inside focus directive"); // find the first invalid element var firstInvalid = elem[0].querySelector('.ng-invalid'); //if we find one, set focus if (firstInvalid) { firstInvalid.focus();

How to handle onChange with Angular Schema Form Checkbox boolean?

匆匆过客 提交于 2019-12-23 19:22:12
问题 I can't seem to get this onChange event to fire. I have added the method to the code as per the documentation but nothing is happening. $scope.schema = { "type": "object", "title": "Comment", "properties": { "comment": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "boolean", "title": "Name" }, "eligible": { "type": "boolean", "title": "Eligible for awesome things" }, "code": { "type":"boolean", "title": "The Code" } } } }, "comment2": { "type": "boolean",

angular schema form - how can I create a “total” field

你离开我真会死。 提交于 2019-12-22 13:54:06
问题 Is there a way to create a custom fieldtype in angular schema form that is able to sum other fields on the form? I've looked at directives/decorators but am not sure how to reference the fields to be summed? 回答1: The easiest way is probably to let the user supply the keys of the fields you'd like to sum up the and watch for changes with a $watchGroup So an example of how a form definition could look: { type: "sum", sumFields: [ "key.to.field1", "key.to.field2", "key.to.field3" ] } And then

how to generate form dynamically in angular js?

≡放荡痞女 提交于 2019-12-12 22:12:20
问题 I am using this https://github.com/Textalk/angular-schema-form plugin to generate my form will not display .I study all documentation and add all js required i didn't get any error but it not display why ? http://plnkr.co/edit/FO5iEs6ulmP3aR0PW4nt?p=preview <!DOCTYPE html> <html > <head> <link data-require="bootstrap-css@3.x" data-semver="3.2.0" rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" /> <script data-require="angular.js@*" data-semver="1.3.0

angular schema-form modal…problems with $scope

瘦欲@ 提交于 2019-12-10 13:38:26
问题 Plunker This plunker allows you to edit rows in a grid. I have created a new method based on RowEditCtrl to insert a new row but am having trouble with the validation. When I insert a new row, the form is "pristine and valid". In the insert method, I need to call $scope.$broadcast('schemaFormValidate') which will validate the form and form.$valid will be false. Ideally, I would like to call this check from ng-show on the save button so the button does not appear until the form is ok. The

angular schema form - how can I create a “total” field

时间秒杀一切 提交于 2019-12-06 08:19:13
Is there a way to create a custom fieldtype in angular schema form that is able to sum other fields on the form? I've looked at directives/decorators but am not sure how to reference the fields to be summed? davidlgj The easiest way is probably to let the user supply the keys of the fields you'd like to sum up the and watch for changes with a $watchGroup So an example of how a form definition could look: { type: "sum", sumFields: [ "key.to.field1", "key.to.field2", "key.to.field3" ] } And then you need a directive in your field type sum to actually sum things up. (WARNING, untested code) <div