title: how to pass index to component angular 2
body: <p>It's not a duplicate. I've done my research. if you still feel, that its not a good question, write the answer in comment and ill delete the question. What I want to do I pass the value of index from HTML element to the component.</p>
  
  <pre><code>&lt;ul *ngFor="let person of persons; let i= index" [index]="i"&gt;
  </code></pre>
  
  <p>//component of the ^^^^^ view above</p>
  
  <pre><code>class appComponent{
  @Input() index; // this should get the value of index; but it gives undefined
  }
  </code></pre>