title: How to hide the button when array reaches the length in angular2
body: <p>I want to limit the items to 4 each time. Once all the items gets displayed, i want to get the index of the last item from outside ngFor loop to hide the button.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>this.limit = 4;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;ng-container *ngFor="let item of items; let i=index"&gt;
    &lt;template [ngIf]="i&lt;limit"&gt;{{item}}   
     &lt;/template&gt;
  &lt;/ng-container&gt;
  
  &lt;div *ngIf=""&gt;
    &lt;button (click)="limit=limit+4"&gt;Show More&lt;/button&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>