Simple way to hide the first button in the list of buttons in angular2 template?

Ramya S Source

enter image description here

Here under the section, i have set of buttons, i always need to hide the first button in that list of buttons.How can i do that?

This is my html template

 <section class="list-group results" *ngIf="showSuggestions">
        <div class="typeahead-backdrop" (click)="hideSuggestions()"></div>
        <button  type="button" class="list-group-item"
          *ngFor="let result of results; let i = index;"
          []="markIsActive(i, result)"
          <span *ngIf="!taItemTpl"><i class="fa fa-search"></i> {{ result }}</span>
            [ngTemplateOutletContext]="{ $implicit: {result: result, index: i} }"

Is there any simple way to achieve this?Thanks in advance!



answered 6 months ago Kraken #1

you can just add slice pipe to it, and first element won't appear

*ngFor="let result of results | slice:1"

Hope it will help you.

comments powered by Disqus