diff options
Diffstat (limited to 'stories/ng2-component-lab/utils/pipes/keys.pipe.ts')
-rw-r--r-- | stories/ng2-component-lab/utils/pipes/keys.pipe.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/stories/ng2-component-lab/utils/pipes/keys.pipe.ts b/stories/ng2-component-lab/utils/pipes/keys.pipe.ts new file mode 100644 index 0000000..2a58cd8 --- /dev/null +++ b/stories/ng2-component-lab/utils/pipes/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; + } +} + |