我怎样才能将id解析为我的变量?

时间:2018-01-11 07:05:33

标签: php angularjs

如何将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>

1 个答案:

答案 0 :(得分:0)

试试这个

 <td ng-repeat='(id, name) in workTypes' class='pushCentre'>
    {{ day.userData.quantities[id] }}</td>