How do you sort(by key) a list of data coming from Firebase realtime database?
This is the HTML code for that i use
<div *ngFor="let transaction of getTransactionList | async">
{{ transaction.amount }}
</div>
And this is the javascript/angular code that i use to get the data from firebase.
import { Observable } from 'rxjs/Observable';
export class HomeComponent implements OnInit {
getTransactionList: Observable<any[]>;
constructor(public afAuth : AngularFireAuth,
public afData: AngularFireDatabase, public router: Router) {
let transactionTemp = this.afData.list('transaction');
this.getTransactionList = transactionTemp.valueChanges();
}
}