title: Angular: Change boolean value on click
body: <p>So, I have a toggle button and a function. I want that when I click on my button, my boolean value goes from <code>TRUE</code> to <code>FALSE</code> and from <code>FALSE</code> to <code>TRUE</code>. And then this value is send to my function.</p>
  <p>Below you can find the html and ts:</p>
  <pre><code> &lt;mat-slide-toggle id='stop-camera' (change)='stopCamera($event)'&gt;&lt;/mat-slide-toggle&gt;
  </code></pre>
  <p>.</p>
  <pre><code>  public stopCamera($event: boolean) : void{
      let num : 0;
      $event =! $event;
      if($event===true){
        console.log('Hi ' +num);
      }else{
        console.log('False');
      }
    }
  </code></pre>
  <p>The problem here is that my console only returns me falses...</p>
  <p>I know it's something really basic and even simple, but because it's so simple and basic I can't find out how to do it... So I would like to get some help please .
  I thank in advance anyone who will take the time to help me.</p>
  <p>P.S: I'm on Angular 9 right now.</p>