title: How to enable input field based on another input field value in AngularJs
body: <p>I have an AngularJs form where I want to know the amount of hours worked. If the amount is <code>0</code>, I want to enable an extra question for the reason of not working.</p>
  
  <pre><code>&lt;label&gt;How many hours did you work?&lt;/label&gt;
  &lt;input ng-model="hours" type="number" placeholder="8" /&gt;
  
  &lt;label ng-class="{'disabled-label': ifHoursZero}"&gt;Why didn't you work at all?&lt;/label&gt;
  &lt;input ng-disabled="ifHoursZero" ng-model="reason" type="text" /&gt;
  </code></pre>
  
  <p>What is the elegant Angular way to toggle CSS and input fields with <code>ifHoursZero</code> if the <code>hours</code> value is <code>0</code>. Can this be done directly with the <code>hours</code> variable with some pattern?</p>