我有以下div块,我在observable上迭代 接下来,当我尝试设置ngStyle时,我将ngStyle的值设为[Object object]而不是string。
<div class = "circle-logo-btm pull-left cp" *ngFor= "let imageUrl of (allAppBGIMageURLs$ | async)" (click)="selectApplication(1)">
<div [ngStyle]="{'background-image':'url(' + imageUrl + ')'}" class=" btn-round"></div>
</div>
这是渲染的结果,它作为对象而不是实际的图像URL
<div xmlns="http://www.w3.org/1999/xhtml" _ngcontent-c3="" class=" btn-round" ng-reflect-ng-style="[object Object]"></div>