Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/192.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
尝试获取样式=";左边距:{{data}}&引用;工作 index.ts 气泡:任意[][]=['80%,'Meeting',['20%,'Meeting']] index.html_Html_Css_Angular_Margin_Ngfor - Fatal编程技术网

尝试获取样式=";左边距:{{data}}&引用;工作 index.ts 气泡:任意[][]=['80%,'Meeting',['20%,'Meeting']] index.html

尝试获取样式=";左边距:{{data}}&引用;工作 index.ts 气泡:任意[][]=['80%,'Meeting',['20%,'Meeting']] index.html,html,css,angular,margin,ngfor,Html,Css,Angular,Margin,Ngfor,我试图让左边距样式使用数组气泡[0]中的数据 for循环在该布局中给出了['80%','Meeting'],因此我尝试将该数组的0元素设置为左边距样式,但这不起作用。是否有其他方法来执行此过程?使用[ngStyle]而不是样式。文件 使用[ngStyle]而不是样式。文件 除了@Pengyy的answser,您还可以使用 <div class="bubble" [ngStyle]="{'margin-left': bubble[0]}"> 除了@Pengyy的answser,您还可

我试图让左边距样式使用数组气泡[0]中的数据


for循环在该布局中给出了['80%','Meeting'],因此我尝试将该数组的0元素设置为左边距样式,但这不起作用。是否有其他方法来执行此过程?

使用
[ngStyle]
而不是
样式
。文件


使用
[ngStyle]
而不是
样式
。文件


除了@Pengyy的answser,您还可以使用

<div class="bubble" [ngStyle]="{'margin-left': bubble[0]}">

除了@Pengyy的answser,您还可以使用

<div class="bubble" [ngStyle]="{'margin-left': bubble[0]}">


我得到了这个错误:解析器错误:绑定表达式不能在表达式[{'margin-left':bubble[0]};]@ThomasY抱歉,我们必须删除
从表达式结尾。@ThomasY使用
来拆分它们,例如
{'attr1':xx,'attr2':yy}
。我得到这个错误:解析器错误:绑定表达式不能在表达式的结尾包含链式表达式[{'margin-left':bubble[0]};]@ThomasY抱歉,我们必须删除
从表达式末尾开始。@ThomasY使用
拆分它们,例如
{'attr1':xx,'attr2':yy}
。”。
<div class="bubble" [style.margin-left]="bubble[0]">