【发布时间】:2021-10-06 07:53:53
【问题描述】:
我想将我的组件属性值传递给内联 css。
<div [ngStyle]="{ 'width': '{{ object.value }}%' }">
该方法不起作用并出现错误:-
Parser Error: Got interpolation ({{}}) where expression was expected
【问题讨论】:
-
没有 {{ 和 }} 只是
[ngStyle]="{ 'width': object.value + '%' }"
标签: css interpolation angular9 inline-styles