title: Clear input fields when checkbox is checked
body: <p>I have a check box and two input fields. Either the check box has to be checked or the two input fields have to be filled in. I'm doing validation using Angular i.e. ng-show, ng-required. </p>
  
  <p>When the checkbox is checked the two input fields are disabled i.e. ng-disabled="$parent.vm.selectAllDates". </p>
  
  <p>Now I also have to clear any data that may have been entered into the textboxes. </p>
  
  <p>The check box is not checked on page load. It is set in the controller like this: vm.selectAllDates = false;</p>
  
  <p>Is there some way to clear the input fields when the check box is checked in Angular?</p>
  
  <p>EDIT
  I've added what I tried doing using your example</p>
  
  <p>Check box:</p>
  
  <pre><code>&lt;input name="dateSelectAll" type="checkbox" 
             ng-model="$parent.vm.selectAllDates" 
             ng-required="vm.selectedReport.Parameters.StartDate == null &amp;&amp; vm.selectedReport.Parameters.EndDate == null" /&gt;All Available Dates
  </code></pre>
  
  <p>Start date input:</p>
  
  <pre><code> &lt;input name="beginningDate" type="text" class="form-control form-field" datepicker-popup="dd-MMM-yyyy"
             ng-disabled="$parent.vm.selectAllDates"
             ng-model="$parent.vm.selectedReport.Parameters.StartDate"
             is-open="beginningDateOpened"
             ng-required="$parent.vm.selectAllDates == false"
             ng-change="$parent.vm.selectedReport.Parameters.StartDate = $parent.vm.selectAllDates ? '' : $parent.vm.selectedReport.Parameters.StartDate"
             close-text="Close" /&gt;
  </code></pre>
  
  <p>End date:</p>
  
  <pre><code> &lt;input name="endDate" type="text" class="form-control form-field" datepicker-popup="dd-MMM-yyyy"
             ng-disabled="$parent.vm.selectAllDates"
             ng-model="$parent.vm.selectedReport.Parameters.EndDate"
             is-open="endDateOpened" ng-change="$parent.vm.selectedReport.Parameters.EndDate = $parent.vm.selectAllDates ? '' : $parent.vm.selectedReport.Parameters.EndDate"
             ng-required="$parent.vm.selectAllDates == false &amp;&amp; $parent.vm.selectedReport.Parameters.EndDate == null"
             close-text="Close" /&gt;
  </code></pre>
  
  <p>One really odd thing was I wanted to see what was happening so I added </p>
  
  <pre><code>{{$parent.vm.selectedReport.Parameters.StartDate = $parent.vm.selectAllDates ? '' : $parent.vm.selectedReport.Parameters.StartDate}}  
  </code></pre>
  
  <p>after the StartDate input field. When I selected a date, the date was added to the input field as well as underneath the input. When I clicked the check box, the date was removed from the input field as well as from under the input field. So it worked! But the minute I removed the above code from under the input field it stopped working...I was like wha?</p>