Skip to content
Snippets Groups Projects
Commit a7bfb663 authored by Lukas Mauß's avatar Lukas Mauß
Browse files

Sort room-list by names

parent a7094a7a
No related merge requests found
...@@ -20,10 +20,18 @@ export class DeleteAccountComponent implements OnInit { ...@@ -20,10 +20,18 @@ export class DeleteAccountComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.roomService.getCreatorRooms().subscribe(rooms => { this.roomService.getCreatorRooms().subscribe(rooms => {
this.rooms = rooms; this.rooms = rooms;
this.sortRooms();
}); });
} }
close(type: string): void { close(type: string): void {
this.dialogRef.close(type); this.dialogRef.close(type);
} }
sortRooms() {
const roomList = this.rooms.sort((a, b) => {
return a.name > b.name ? 1 : -1;
});
this.rooms = roomList;
}
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment