title: How to pass the index value of a ngFor loop into the component?
body: <p>I have a ngFor loop in my code.
  and inside this ngFor loop I have a div, on clicking this div I want to pass the index value to the type script file.</p>
  
  <p>I am new to Anglular 2 any help will be appreciated.</p>
  
  <p>Eg:</p>
  
  <pre><code>`&lt;div *ngFor="let y of characters;let i = index"&gt;
      &lt;div (click)="passIndexValue()"&gt;
      &lt;/div&gt;
  &lt;div&gt;`
  </code></pre>