title: pass element ref to a method in angular2
body: <p>I have to check if an element in a list is within the viewport or not.For this i'm using the angular2 plugin <a href="https://github.com/thisissoon/angular-inviewport" rel="noreferrer">angular-inviewport</a>.</p>
  
  <p>What the plugin does is as soon as the card is withing the bottom of the window it return true.I want that the card should be in the center or at least somewhat near to the top of the window before i register the impression.
  For this i need the reference of the current element and compare it with the window height and Yoffset something like <a href="https://stackoverflow.com/questions/43754551/how-to-check-the-element-is-in-viewport-on-angular-2">this</a>(the last solution) .</p>
  
  <p>Below is a small snippet from my code and the callback i have.</p>
  
  <pre><code>    &lt;li class="" *ngFor="let data of dataArray; let i=index;"&gt;
           &lt;div id="data{{data.Id}}" snInViewport (inViewportChange)="handlerFunction($event,data)" class="card m-b-" style="height:auto;"&gt;
          &lt;/div&gt;
     &lt;/li&gt;
  </code></pre>
  
  <p>even tried adding dynamic ref</p>
  
  <pre><code>&lt;div #data_{{data.Id}} id="data{{data.Id}}" snInViewport (inViewportChange)="handlerFunction($event,data)" class="card m-b-" style="height:auto;"&gt;
  </code></pre>
  
  <p>Not sure if this is correct.</p>
  
  <p>Inside the handlerFunction i want the div reference also.</p>
  
  <p>How can i achieve this.
  Any suggestion,approach or guidance is welcome!</p>
  
  <p>Thanks</p>