title: Angular detect If checkbox is checked from the .ts
body: <p>I am using Angular 4 and I have a checkbox on my component on the component's html template file:</p>
  
  <pre><code>&lt;input type="checkbox" (change)="canBeEditable($event)"&gt;
  </code></pre>
  
  <p>On my component's .ts file I have this which set's the value to true.</p>
  
  <pre><code>toggleEditable() {
      this.contentEditable = true;
  }
  </code></pre>
  
  <p>My problem is that I only want the value changed IF the checkbox IS checked.</p>
  
  <p>So it would look something like:</p>
  
  <pre><code>toggleEditable() {
      if (checkbox is checked) {
        this.contentEditable = true;
      }
  }
  </code></pre>
  
  <p>How can I do this?</p>