aboutsummaryrefslogtreecommitdiffstats
path: root/stories/ng2-component-lab/utils/pipes/keys.pipe.ts
blob: 2a58cd8619424cae8aee56d0bee389a155ae5717 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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;
    }
}