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"
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"
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.