title: exit from angular component
body: <p>I want to kill the current angular component in a certain condition
  I am trying to detect browser back arrow pressed by user and exit from this component for exit from the app in web view</p>
  
  <pre><code>if (window.history &amp;&amp; window.history.pushState) {
    (&lt;any&gt;window).onpopstate = function (e) {
      const urlPartsList = window.document.location.href.split('/');
      const urlLastPart = urlPartsList[urlPartsList.length - 1];
      if (urlLastPart === 'koodakish') {
        this.close.emit(null);  //NOT WORK
      }
    };
  }
  </code></pre>