如何将id键解析为我的角度js变量?我想将以下PHP代码转换为角度js。
<?php foreach($workTypes as $id => $name) { ?>
<td class='pushCentre'><?php echo $day['userData']['quantities'][$id]; ?></td>
<?php } ?>
我在Angular JS v1中的尝试
<td ng-repeat='(id, name) in workTypes' class='pushCentre'>
{{ day.userData.quantities.{{id}} }}</td>
答案 0 :(得分:0)
试试这个
<td ng-repeat='(id, name) in workTypes' class='pushCentre'>
{{ day.userData.quantities[id] }}</td>