title: Passing Variable as parameter in onclick method in Angular
body: <p>I am writing a html in where the html will display a list of records with three fields - id, name and an icon. When the icon will be clicked by user, a method will be called where the id will be passed as parameter and details of that record will be returned. The code snipped I am following is as below - </p>
  
  <pre><code>&lt;tr *ngFor="let userDetail of userDetails"&gt;
                    &lt;td&gt;{{ userDetail.id }}&lt;/td&gt;
                    &lt;td&gt;{{ userDetail.firstname }}  {{userDetail.lastname}}&lt;/td&gt;
                    &lt;td&gt;&lt;a href="javascript:void(0);" (click) = "showUserDetails()" &gt;&lt;img src="/assets/user_details.png" width="20" height="20" /&gt;&lt;/a&gt;&lt;/td&gt;
                  &lt;/tr&gt;
  </code></pre>
  
  <p>Here I need to pass the userDetail.id when the showUserDetails() function will be created. But still unable to pass the parameter.
  What will be best way to pass that parameter?
  Thanks in advance.</p>