title: Angular 4 checkbox change value
body: <p>how could you achieve in Angular 4 that when you register in a checkbox save an &quot;A&quot; or &quot;B&quot; value. As much as I try, he is only sending me true or false, I hope someone can help me.</p>
  <p>registry.component.ts</p>
  <pre><code>  this.userForm = new FormGroup({
     state: new FormControl('',),
    });
  </code></pre>
  <p>registry.component.html</p>
  <pre><code>&lt;div class=&quot;form-group&quot;&gt;
    &lt;label&gt;State&lt;/label&gt;
    &lt;input type=&quot;checkbox&quot;
           [(ngModel)]=&quot;isChecked&quot;
           (change)=&quot;checkValue(isChecked?'A':'B')&quot;
           formControlName=&quot;state&quot;/&gt;
  &lt;/div&gt;  
  
  &lt;pre&gt;{{userForm.value | json}}&lt;/pre&gt;
  </code></pre>
  <p>That way I can get the console to show the value I want (A or B) but in the JSON is still true or false.</p>