Created
September 16, 2018 23:11
-
-
Save code-vagabond/abe168170168f0a33a91223860ba9253 to your computer and use it in GitHub Desktop.
Reverse an observable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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