【发布时间】:2018-07-23 02:28:04
【问题描述】:
图像路径在 item.imagePath 中定义。
<div *ngFor="let item of itemList">
<div style="background-image: url(item.imagePath)" class="thumb">
<span>{{item.productName}}</span>
</div>
<div>
<p>{{item.productFeature}}</p>
</div>
</div>
style="background-image: url(item.imagePath)"
什么是正确的语法,因为这不起作用?
【问题讨论】:
-
使用 ng-style 更多关于下面的链接apply-css-style-attribute-dynamically-in-angular-js