title: click button from template Angular 6
body: <p>I have this function:</p>
  
  <pre><code> windowInfo_(marker, i, data) {
        '&lt;div style="' + this.content_ + '"&gt;' +
        '&lt;div&gt;' +
        '&lt;img [src]="' + "'" + this.image + "'" + '"' + ' style="' + this.image_ + '" alt="avatar"&gt;' +
        '&lt;/div&gt;' +
        '&lt;div style="' + this.details_ + '"&gt;' +
        '&lt;div&gt;' +
        '&lt;h5 style="' + this.company_name + '"&gt;' + data.company_name + '&lt;/h5&gt;' +
        '&lt;i class="fa fa-map-marker" id="' + this.country_city + '"&gt;' + data.country + ',' + data.city + '&lt;/i&gt;' +
        '&lt;/div&gt;' +
        '&lt;/div&gt;' +
        '&lt;/div&gt;' +
        '&lt;button class="' + this.footerListing + '" type="button" (click)="details(data.id_listing)"&gt;Explore Trips&lt;/button&gt;'
  }
  
  details(id) {
      console.log(id)
  }
  </code></pre>
  
  <p>As you can see, I have a button inside this template, and I want when I click it, <code>details</code> function to be triggered. But when I click it, nothing is happening. What do I need to modify in order to trigger the function? Thank you for your time!</p>