Tri des DZs par "isFavorite" et affichage
de l'étoile
This commit is contained in:
@@ -33,6 +33,8 @@
|
|||||||
<mat-autocomplete #autoDropZone="matAutocomplete" [displayWith]="displayFn">
|
<mat-autocomplete #autoDropZone="matAutocomplete" [displayWith]="displayFn">
|
||||||
<mat-option *ngFor="let dropZone of listOfDropZone" [value]="dropZone">
|
<mat-option *ngFor="let dropZone of listOfDropZone" [value]="dropZone">
|
||||||
{{dropZone.name}}
|
{{dropZone.name}}
|
||||||
|
<img src="../../assets/img/favorite.png" alt="favorite DZ" *ngIf="dropZone.isFavorite === true"
|
||||||
|
style="width: 16px;">
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-autocomplete>
|
</mat-autocomplete>
|
||||||
<button mat-button *ngIf="selectedDz" matSuffix mat-icon-button aria-label="Clear" (click)="selectedDz=undefined">
|
<button mat-button *ngIf="selectedDz" matSuffix mat-icon-button aria-label="Clear" (click)="selectedDz=undefined">
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ export class NewJumpComponent implements OnInit {
|
|||||||
|
|
||||||
private getListOfDropZones() {
|
private getListOfDropZones() {
|
||||||
this.serviceApiGet.getListOfDropZones().subscribe(data => {
|
this.serviceApiGet.getListOfDropZones().subscribe(data => {
|
||||||
|
data.sort((a, b) => (b.isFavorite ? 1 : 0) - (a.isFavorite ? 1 : 0));
|
||||||
this.listOfDropZone = data;
|
this.listOfDropZone = data;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user