我有一个像这样的几行的json:
{{"0":"94122","1":"94132","2":"94131","3":"94116","4":"94107"}
{"0":4,"1":2,"2":4,"3":2,"4":2}}
当我这样称呼时:
<li ng-repeat="x in table">
{{ x }}
</li>
我明白了:
{"0":"94122","1":"94132","2":"94131","3":"94116","4":"94107"}
{"0":4,"1":2,"2":4,"3":2,"4":2}
如何将其显示为如下表格:
<tr ng-repeat="roll in sushi">
<td>{{ roll.name }}</td>
<td>{{ roll.fish }}</td>
<td>{{ roll.tastiness }}</td>
</tr>
答案 0 :(得分:2)
while something:
[tab] do those things
Q;
continue with other statements
或
<tr ng-repeat="x in table">
<td ng-repeat="(key, value) in x">{{value}}</td>
</tr>
或
<tr ng-repeat="x in table">
<td>
<p ng-repeat="(key, value) in x">{{value}}</p>
</td>
</tr>
答案 1 :(得分:1)
你想要这样的东西吗?
<tr ng-repeat="x in table">
<td>{{ x["0"] }}</td>
<td>{{ x["1"] }}</td>
<td>{{ x["2"] }}</td>
<td>{{ x["3"] }}</td>
<td>{{ x["4"] }}</td>
</tr>