ng-repeat

1.对象

<tr ng-repeat="(x,y) in tableData">
    <td>{{x}}</td>
    <td>{{y}}</td>
</tr>

//
tableData = {
//      "Name" : "Alfreds Futterkiste",
//      "Country" : "Germany",
//      "City" : "Berlin"
// }

2.数组

<tr ng-repeat="x in Labels">
  <td>{{x.name}}</td>
  <td>{{x.Country}}</td>
</tr>

// Labels = [
//     {
//          "Name" : "Alfreds Futterkiste",
//          "Country" : "Germany"
//      },{
//          "Name" : "Berglunds snabbköp",
//          "Country" : "Sweden"
//      },{
//          "Name" : "Centro comercial Moctezuma",
//          "Country" : "Mexico"
//      }
//  ]

 

posted @ 2016-12-13 09:55  -cyber  阅读(196)  评论(0编辑  收藏  举报