title: I have a list of checkboxes and a submit button in AngularJS
body: <p>I like to enable the cancel button if minimum one job is checked.</p>
  
  <h3>This is my HTML View</h3>
  
  <pre><code>&lt;table&gt;
     &lt;tr ng-repeat="x in jobs" ng-class-odd="'odd'" ng-class-even="'even'"&gt;
       &lt;td style="width: 247px;"&gt;
          &lt;input type="checkbox" ng-model="checked"&gt;
       &lt;/td&gt;
       &lt;td style="width: 247px;"&gt;{{ x.Name }}&lt;/td&gt;
       &lt;td style="width: 247px;"&gt;{{ x.Id }}&lt;/td&gt;
     &lt;/tr&gt;
  &lt;/table&gt;
  
  &lt;button ng-click="myFunc()" ng-disabled="countChecked()!=1"&gt;Cancel&lt;/button&gt;
  </code></pre>
  
  <h3>This is my script</h3>
  
  <pre><code>$scope.countChecked = function(){
     var count = 0;
     angular.forEach($scope.jobs, function(){
       if (checked) count++;
     });
  
     return count;
   }
  </code></pre>
  
  <p>Iam new to AngularJS.</p>