Skip to content Skip to sidebar Skip to footer

How To Handle OnChange With Angular Schema Form Checkbox Boolean?

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'

Solution 1:

Figured this one out Friday. I need to reference each property by key in the form definition.

Reference the updated plunker: http://plnkr.co/edit/XJGuPYPBDc7520vjWtbI?p=preview

 $scope.form = [
{
  key: 'comment',
  add: null,
  remove: null,
  title: false,
  notitle: true,
  items: 
  [
    {
      key: "comment.name",
      title: 'This',
      type: 'boolean',
      onChange: function(model, form){
        alert('got there ' + model.toString());
      }
    },
     {
      key: "comment.elgible",
      title: 'This',
      type: 'boolean',
      onChange: function(model, form){
        alert('got there though');
      }
    },
     {
      key: "comment.code",
      title: 'This',
      type: 'boolean',
      onChange: function(model, form){
        alert('got there though');
      }
    },
    ]
},

{
  type: "submit",
  title: "Save"
}
];

Post a Comment for "How To Handle OnChange With Angular Schema Form Checkbox Boolean?"