0

like in angular 1 we can repeat json object in following way :

ng-repeat="state(k,v) in states"

then using {{k}} or {{v}}

But how to do it for angular 2 ?

*ngFor="let state of states"
Maximilian Riegler
  • 22,720
  • 4
  • 62
  • 71

1 Answers1

0

Unfortunately, I haven't seen a simpler method to iterate and get the keys using '*NgFor' than the one here: iteration a json object on Ngfor in angular 2

It's basically creating a custom pipe to set the keys as properties you can access in the loop.

Hope it helps.

Community
  • 1
  • 1