title: Angular 2 Reactive Forms Checkbox - Bind Bool to Number
body: <p>I have a form model with some indicators that are represented as checkboxes.  Currently they model their value as true/false in the form object json.  What I would like is for their value to convert from a boolean to a number, 1/0 respectively.  Is there a smart way to do this?</p>
  
  <p>Example code: </p>
  
  <pre><code>@Component
  
  template: `
       &lt;form [formGroup]="myForm" (ngSubmit)="save(myForm.value)"&gt;
           &lt;input type="checkbox" id="myToggle" formControlName="myToggle"/&gt;
       &lt;/form&gt;
  `
  export class MyComponent implementes OnInit{
  private myForm:FormGroup;
  myToggle: number;
  
  constructor(private _fb:FormBuilder) {}
  
  ngOnInit() {
      this.myForm = this._fb.group({
        myToggle: [0]
      });
  }
  </code></pre>
  
  <p>Hopefully the above is demonstrating that I'm trying to set the type of "myToggle" to a number.  Initializing the form is setting the default to 0 and correctly leaving the checkbox unchecked.  However, updating the checkbox to checked will set the form value to true instead of 1.  I want it to be updated to 1.  Via <a href="https://stackoverflow.com/questions/7820683/convert-boolean-result-into-number-integer">this question</a> I see that there are some options for converting booleans to numbers.  However, I'm unsure of exactly how to implement this with the reactive form model. </p>