title: remove event listener in angular 2
body: <p>I have a function like so:</p>
  
  <pre><code>mouseClickNav() {
  
      document.getElementById('mouseClickNav').style.width = '319px';
      let ctx: CanvasRenderingContext2D = this.canvasTest.nativeElement.getContext('2d');
  
      ctx.canvas.addEventListener('click', (event) =&gt; {
          var mouseX = event.clientX - ctx.canvas.offsetLeft;
          var mouseY = event.clientY - ctx.canvas.offsetTop;
          this.mouseClickX = mouseX;
          this.mouseClickY = mouseY;
      });
  </code></pre>
  
  <p>Which works fine, and adds the event listener. However, I cannot seem to figure out how to remove it after im done with it. The next function is where i want to remove the listener:</p>
  
  <pre><code>closeMouseClickNav() {
      document.getElementById('mouseClickNav').style.width = '0';
      let ctx: CanvasRenderingContext2D = this.canvasTest.nativeElement.getContext('2d');
      ctx.canvas.removeEventListener('click', () =&gt; { });
   }
  </code></pre>
  
  <p>Not sure what I am doing wrong here. I declared the listener and added it, when i remove it doesnt it have to be the same?</p>