Last active
April 14, 2023 23:58
-
-
Save chriseugenerodriguez/ae19c91d4077de176f8c70fa03de1d8b to your computer and use it in GitHub Desktop.
Array Loop for Objects (Angular)
This file contains hidden or 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 { PipeTransform, Pipe } from '@angular/core'; | |
@Pipe({ name: 'keys' }) | |
export class KeysPipe implements PipeTransform { | |
transform(value, args: string[]): any { | |
let keys = []; | |
// tslint:disable-next-line:forin | |
for (let key in value) { | |
keys.push(key); | |
} | |
return keys; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment