我要渲染动态标题的表,我的意思是,我不想做这样的事情在HTML渲染表动态标题
<table>
<tr>
// THIS TABLE ROW IS WHAT I SAY
<th>here info</th>
<th>something here</th>
<th>another header</th>
</tr>
<tr ng-repeat="thing in things">
<td>{{thing.asfs}}</td>
<td>{{thing.asx}}</td>
<td>{{person.dsf}}</td>
</tr>
</table>
我想是这样的
<table>
<tr ng-repeat="head in heads">
{{head}}
</tr>
<tr ng-repeat="bar in bars">
<td ng-repeat="foo in foos"></td>
</tr>
</table>
,这只是一个例子,我需要这个数据来做到这一点:
{
"55f6de98f0a50c25f7be4db0":{
"clicks":{
"total":144,
"real":1
},
"conversions":{
"total":4,
"amount":229
},
"cost":{
"cpc":0.1999999999999995,
"ecpc":1145.0000000000027,
"total":28.79999999999993
},
"revenue":{
"total":4,
"epc":0.027777777777777776
},
"net":{
"roi":-1.1612903225806457,
"total":4
},
"name":"Traffic Source #2",
},
"55f6de98f0a50c25f7be4dbOTHER":{
"clicks":{
"total":144,
"real":1
},
"conversions":{
"total":4,
"amount":229
},
"cost":{
"cpc":0.1999999999999995,
"ecpc":1145.0000000000027,
"total":28.79999999999993
},
"revenue":{
"total":4,
"epc":0.027777777777777776
},
"net":{
"roi":-1.1612903225806457,
"total":4
}
"name":"Traffic Source #3"
},
}
每一个关键,例如点击次数,转换成本,E tc,应该是td
,这只是我不想要静态HTML。
有什么建议吗?
编辑
,并且有时该对象将增长,能想出这样一个55f6de98f0a50c25f7be4db0
一些键我没有这个拨弄着完全相同的数据我收到
执行'$ scope.peopleKeys = Object.keys(people);',然后'
@jperezov但我如何适应我收到的数据?因为实际上,你应该看到我正在接收一个对象,而不是一个数组。 – TheUnnamed
因此,您具有不同的具有不同尺寸的对象,您如何对它们进行成像以适合一个表格? – vittore