title: At least one checkbox validation AngularJs
body: <p>I'm trying to do a validation that validate an input <code>checkbox</code> when at least 1 option has been checked.</p>
  
  <p>I followed an example found that require a <code>controller</code> but I would like have it <strong>without</strong> use a controller maybe a directive for that. How can i achieve that?</p>
  
  <p>This example use a controller:</p>
  
  <p><strong>Html</strong></p>
  
  <pre><code>&lt;input
      type="checkbox"
      value="{{val.id}}"
      ng-model="formData.selectedFruits[val.id]"
      ng-required="!someSelected(formData.selectedFruits)"
  &gt;
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>$scope.someSelected = function (object) {
    return Object.keys(object).some(function (key) {
      return object[key];
    });
  }
  </code></pre>