Skip to content

Instantly share code, notes, and snippets.

@codediodeio
Created July 3, 2017 14:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save codediodeio/5b0cb8943ed450ae168ddb576e8aab72 to your computer and use it in GitHub Desktop.
Save codediodeio/5b0cb8943ed450ae168ddb576e8aab72 to your computer and use it in GitHub Desktop.
Reverse a FirebaseListObservable in Angular 4
<div *ngFor="let item of listObservable | async | reverse">
{{item?.whatever}}
</div>
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'reverse'
})
export class ReversePipe implements PipeTransform {
transform(value) {
if (!value) return;
return value.reverse();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment