My Service
get ActivityList():any {
return this.activityList.snapshotChanges().map(changes => {
return changes.map(c => ({
key: c.payload.key, ...c.payload.val();
}));
});
}
My Component
getActivity() {
this.activityService.ActivityList.subscribe(activity => {
this.activity = activity;
});
}
HTML
<div *ngFor="let item of activity">
{{item.created|date:'medium'}}
</div>
Question
This is how I am currently getting my activity from Firebase RealTime Database. where and how is the best way to modify this to sort by the created value.