diff options
Diffstat (limited to 'stories/angular/helpers/keys.pipe.ts')
-rw-r--r-- | stories/angular/helpers/keys.pipe.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/stories/angular/helpers/keys.pipe.ts b/stories/angular/helpers/keys.pipe.ts new file mode 100644 index 0000000..2a58cd8 --- /dev/null +++ b/stories/angular/helpers/keys.pipe.ts @@ -0,0 +1,13 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({name: 'keys'}) +export class KeysPipe implements PipeTransform { + transform(value, args:string[]) : any { + let keys = []; + for (let key in value) { + keys.push(key); + } + return keys; + } +} + |