title: How to add classname to only one HTML element onclick in angular 2
body: <p>My JSON data looks like this.</p>
  
  <pre><code>let manageDiscRecords: discRecords[] = [
      {
      "ID"                  : 3,
      "discRec"             : "Some sample record",
      "Tasks"               : [{
                              "ID"          : 7,
                              "discParcel"  : ["string1", "string2"]
                              }]
      }, 
      {
      "ID"                  : 4,
      "discRec"             : "Some sample record 2",
      "Tasks"               : [{
                              "ID"          : 8,
                              "discParcel"  : ["string3", "string4"]
                              }]
      }
  ];
  </code></pre>
  
  <p>My HTML code is: </p>
  
  <pre><code>&lt;li *ngFor="let parcel of discRecords; let i= index"&gt;
                      &lt;a href="#" #elem id="availRecord_{{i}}" (click)="getDisplay(elem.id)"&gt;
                          {{ parcel.discRec}} 
                      &lt;/a&gt;
                          &lt;ul style="list-style: none; display: none;" id="subRecordHolder_{{i}}"&gt;
  
                              &lt;li *ngFor="let task of parcel.Tasks; let i= index" [className]="itemAdded"&gt;
                                  &lt;ul style="list-style: none; padding-left:0"&gt;
  
                                     &lt;li *ngFor="let discParcel of task.discParcel;  let i= index"&gt;  
                                         &lt;a href="#" #elem id="availSubRecords_{{parcel.ID}}_{{task.ID}}_{{i}}" (click)="getStyle(elem.id, discParcel)"&gt;
                                             {{ discParcel}}
                                          &lt;/a&gt;
                                      &lt;/li&gt;
  
                                  &lt;/ul&gt;
                              &lt;/li&gt;
                          &lt;/ul&gt;
                      &lt;/li&gt;
  </code></pre>
  
  <p>My output looks like this.</p>
  
  <pre><code>Some sample record
   - string 1 
   - string 2
  
  some sample record 2
   - string 4
   - string 3
  </code></pre>
  
  <p>Now, i want to apply a class name "clickedNow" with "string 1" element when i click. Can you please let me how to achieve this.</p>