title: Angular and checkbox validation
body: <p>I have a problem with validation. Can someone help me with validation for this four checkboxes? I need custom function that returns error when all <code>checkbox.checked</code> are <code>false</code>. How to solve it?</p>
  
  <p>form.component.html:</p>
  
  <pre><code>&lt;div class="form-group" formControlName="levels"&gt;
      &lt;label&gt;LEVELS&lt;/label&gt;
      &lt;div *ngFor="let data of levels"&gt;
          &lt;input 
            type="checkbox" 
            [checked]="data.checked" 
          &gt; {{data.level}}
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>form.component.ts:</p>
  
  <pre><code>constructor(private _formBuilder: FormBuilder) {
  
      this.levels = [ 
          { level: "Szkoła podstawowa", checked: false }, 
          { level: "Gimnazjum", checked: false }, 
          { level: "Liceum", checked: false }, 
          { level: "Studia", checked: false } 
      ];
  
      this.offerForm = this._formBuilder.group({ 
          levels: null
      });
  
  }
  </code></pre>