title: How can I set a click listener only for Button in angular application
body: <p>I just want to implement a event (click) listner into my angular application, which is only for button. buttons will be created dynamically. </p>
  
  <p>the code looks like this: </p>
  
  <pre><code>  constructor(
      private companyService: CompanyService,
      elementRef: ElementRef,
      renderer: Renderer,
      private router: Router
    ) {
      renderer.listen(elementRef.nativeElement, "onclick", event =&gt; {
        // if (event.target.innerHTML) {
        //   this.searchByVin(event.target.innerHTML);
        // }
      });
    }
  
  
  private setCustomValueFunction() {
      this.customValueFunction = (
        elemValue: string,
        elemKey: string,
        elem: {}
      ) =&gt; {
        if (elemKey === "vin") {
          elemValue = `&lt;div class="gridster-item-content"&gt;&lt;button (click)="searchByVin(${elemValue})"&gt;${elemValue}&lt;/button&gt;&lt;/div&gt;`;
        }
        if (elemKey === "status") {
          elemValue = `
          &lt;mat-icon&gt;done&lt;/mat-icon&gt;`;
        }
        return elemValue;
      };
    }
  
  </code></pre>
  
  <p>this 2 functions, which can create a button dynamically and in constructor will set a click event listner, but this listner is for all click event, the question is, how can I set this listner only for buttons.</p>
  
  <p>Best Regards,</p>
  
  <p>Leo</p>