Skip to content

Instantly share code, notes, and snippets.

@jsayol
Last active December 27, 2016 00:28
Show Gist options
  • Save jsayol/6353ee1b7629f2a4e61eb0df92fdc15f to your computer and use it in GitHub Desktop.
Save jsayol/6353ee1b7629f2a4e61eb0df92fdc15f to your computer and use it in GitHub Desktop.
ngOnChanges(changes: SimpleChanges): void {
if ('ngForIn' in changes) {
this.ngForOf = Object.keys(this.ngForIn);
const currentValue: any[] = Object.keys(changes['ngForIn'].currentValue);
const previousValue: any[] = Object.keys(changes['ngForIn'].previousValue);
changes['ngForOf'] = new SimpleChange(previousValue, currentValue);
super.ngOnChanges(changes);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment