Angular4背景图片

Angular4 background image

我正在尝试为 div 制作背景图片。但图像不显示。这是我的代码。

<div [ngStyle]="{'background-image' : imageresult.pictureUrl}"> some content here! </div>

尝试此操作并确保您已将资产添加到 angular-cli.json

[ngStyle]="{'background-image': 'url(' + imageresult.pictureUrl+ ')'}"