I am trying to use ngFor in Angular 2, sample code below
<a *ngFor="#facet of facet_data" class="collection-item" (click)="setToSearchBarWithFilter(facet.category)">
{{facet.category}}<span class="badge">{{facet.count}}</span>
</a>
I want to apply *ngIf in the anchor tag to show only those tags which has facet.count > 0, something like this:
<a *ngFor="#facet of facet_data" class="collection-item" (click)="setToSearchBarWithFilter(facet.category)" *ngIf="facet.count > 0">
{{facet.category}}<span class="badge">{{facet.count}}</span>
</a>
But facet is not available in the anchor tag, its only available in the template inside the <a> tag, how can I achieve the same, what is the solution.