How can I limit ngFor repeat to some number of items in Angular?
<p>My Code:</p>

<pre class="lang-ts prettyprint-override"><code>&lt;li *ngFor="let item of list; let i=index" class="dropdown-item" (click)="onClick(item)"&gt;
  &lt;template [ngIf]="i&lt;11"&gt;{{item.text}}&lt;/template&gt;
&lt;/li&gt;
</code></pre>

<p>I am trying to have only 10 list elements display at any point. As suggested in the <a href="https://stackoverflow.com/a/36388647/1456913">answer here</a>, I used ngIf but this results in empty list items (beyond 10) showing up on the page.</p>