1

I want to do ng-for on the below object in Angular 2.0

{"apparentTemperature":20.56,"cloudCover":0.05,"dewPoint":8.56,"humidity":0.47,"icon":"wi-forecast-io-clear-night","nearestStormBearing":286,"nearestStormDistance":301,"ozone":296.9,"precipIntensity":0,"precipProbability":0,"pressure":1036.27,"summary":"Clear","temperature":26.08,"time":1449406635,"visibility":8.55,"windBearing":213,"windSpeed":4.59}

just like we used to do in Angular 1.x as:

<tr ng-repeat="(key, value) in data">
<td> {{key}} </td> <td> {{ value }} </td>

Thanks in advance.

Pragyan
  • 146
  • 3
  • 17
  • 2
    I think this could help you http://stackoverflow.com/a/31537666/2435473 & https://github.com/angular/angular/blob/master/modules/angular2/docs/core/01_templates.md#template-microsyntax – Pankaj Parkar Dec 06 '15 at 13:25
  • Thanks. I think this will work but is there any native way to achieve this in ng 2.0 – Pragyan Dec 06 '15 at 13:29
  • The first link @Pankaj referenced shows a native way. Another native way is writing a Pipe that does exactly the same in the first example. – Eric Martinez Dec 06 '15 at 13:36
  • Thanks for pointing that out...I will create and use a pipe. – Pragyan Dec 06 '15 at 13:48

0 Answers0