Set the value of a different field when a field value changes
<p>I'm using Angular Schema Form and I want to set a model property to null when a field value changes. I've tried using <code>onChange</code> in the form definition like so</p>

<pre><code>{
  key: '7_11',
  type: 'radios',
  titleMap: [{value: 'no', name: 'No'}, {value: 'yes', name: 'Yes'}],

  onChange: function(modelValue,form) {
    if (!modelValue) {
      // model['8_1'] = null
    }
  }
}
</code></pre>

<p>Notice that the model property I'm trying to set is bound to a different field than the field that has changed</p>

<p>I can't do it in the manner indicated by the comment, because <code>model</code> is not in scope in the <code>onChange</code> listener. </p>

<h2>Update</h2>

<p>A second example is <a href="https://plnkr.co/edit/CSd5tT?p=preview" rel="nofollow">this Plunker demo</a>. Say we want to clear the 2 checkboxes (by removing the corresponding properties from the model) whenever some text is entered in the Name field, how could this be achieved?</p>

<p>I should also point out that for reasons I won't bore you with, I can't implement this using a conditional and <code>destroyStrategy</code>.</p>