First of all, I'm French so all my apologies for my english...
I would like to order an Observable with *ngFor.
Here is my code :
this.allBoulangeries$ = this.allBoulangeriesService.getAllBoulangeries();
I get all datas from firebase.
Next, I do a *ngFor to display :
<ion-card *ngFor="let boulangerie of allBoulangeries$ | async" tappable (click)="viewDetails(boulangerie)">
<div padding>
<b>{{ boulangerie.name }}</b>
<p>{{ boulangerie.address }}<br>
{{ boulangerie.cp }} {{ boulangerie.ville }}</p>
<p>Distance: {{ distanceTo(boulangerie.coordX, boulangerie.coordY, latitude, longitude) }}</p>
</div>
</ion-card>
My problem that is I want to order the list with the distance value (calculate from coordX and coordY with a function)... For the moment, the list is displayed in alphabetic order.
Thank you very much for your support !