我想在angularjs2使用ngFor访问局部变量在HTML模板,下面使用* ngFor在Angular2
<a *ngFor="#facet of facet_data" class="collection-item" (click)="setToSearchBarWithFilter(facet.category)">
{{facet.category}}<span class="badge">{{facet.count}}</span>
</a>
我想申请* ngIf在锚标记,只显示那些具有标签示例代码facet.count> 0,这样的事情:
<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>
但方面是不具备的锚标记,它只是在<a>
标签内的模板可用,我怎么能达到同样的,该如何解决。