In my template, I have to use *virtualItem
and *ngSwitchCase
bindings together, but when I run app, I face an error that say, “Can’t have multiple template bindings on one element”.
Here is my template:
<ion-list [ngSwitch]="homeList" [virtualScroll]="posts">
<ion-item-sliding *virtualItem="let post" *ngSwitchCase="'news'">
<ion-item (click)="gotoDetails(post)">
<ion-note item-left >
<ion-icon class="fa fa-align-right fa-lg" item-left></ion-icon>
</ion-note>
<h2> {{post.title}} </h2>
</ion-item>
<ion-item-options side="left">
<button class="item-sliding-button" ion-button color="light" (click)="addToFavorites()">
<ion-icon color="favorite" class="fa fa-star-o fa-2x"></ion-icon>
</button>
</ion-item-options>
</ion-item-sliding>
</ion-list>
The aim of this template is using both Segment and VirtualScroll together. Is it possible at all?
What should I do?