I'm trying to implement a table using ng-repeat for the following data :
[{
"Name": "Alfreds Futterkiste",
"City": "Berlin",
"Country": "Germany"
}, {
"Name": "Berglunds snabbköp",
"City": "Luleå",
"Country": "Sweden"
}]
Here is my AngularJS code :
<table>
<tr ng-repeat="d in stuff">
<td>
{{d.Name}}
</td>
<td>
{{d.Country}}
</td>
<td>
{{d.City}}
</td>
</tr>
</table>
The above code works fine but the number of td has been hard coded. Is there any way to make it dynamic.
http://www.jptacek.com/2014/02/angularJS-templates/Not as elegant a solution as Simon has proposed, but would be a possibility for a variety of mixed data content.