【发布时间】:2017-10-24 03:54:45
【问题描述】:
index.ts
bubbles: any [][] = [['80%','Meeting'],['20%','Meeting']]
index.html
<div *ngFor="let bubble of bubbles">
<div class="bubble" style="margin-left:{{bubble[0]}};">
</div>
</div>
我正在尝试让 margin-left 样式使用数组 bubbles[0] 中的数据。
for 循环在该布局中给出 ['80%','Meeting'] ,因此我尝试将该数组的 0 元素设置为 margin-left 样式,但这不起作用。有没有其他方法来完成这个过程?
【问题讨论】:
标签: html css angular margin ngfor