title: Listen to click event on Angular component
body: <p>How to listen to click event on the component and call a method on the component?</p>
  
  <p>Ex - </p>
  
  <p><strong>Component</strong></p>
  
  <pre><code>import { Component } from '@angular/core';
  
  @Component({
    selector: 'my-component',
    template: `
      &lt;div&gt;Hello my name is {{name}}. &lt;/div&gt;
     `
  })
  export class MyComponent {
    name = "Aj"
  }
  </code></pre>
  
  <p><strong>HTML -</strong></p>
  
  <pre><code>&lt;my-component&gt;&lt;/my-component&gt; // user clicks here
  </code></pre>
  
  <p>Now how do I listen to click on the component itself?</p>