Hello,
Hi i want to create a slider from a list of users from firebase and i dont want to include in the list the user who is viewing the list…so here is my code: (Users is an angularfire observable)
<ion-slides [options]="slideOptions">
<ion-slide *ngFor="let user of users | async" (click)="ionSlideTap()" *ngIf="user.$key !== uid">
<ion-card>
........
</ion-card>
</ion-slide>
</ion-slides>
But throws an error that i cant use ngfor and ngif in the same element…If i try to put the ngif inside a , it works but i have a blank slide which i dont want…
Is there any solution for this scenario?
I have also tried filtering with a pipe :
<ion-slide *ngFor="let user of (users | async | filter:uid)" (click)="ionSlideTap()">
and my pipe is this:
export class Filter {
transform(users: Array<any[]>, uid: String): Array<any[]> {
function filterByID(user) {
if (user.$key != Number(uid)) {
return true;
}
}
return users.filter(filterByID);
}
}
But i get a blank screen.
Any help?