问题
I am trying to make a background image to div. but image not showing. here is my code.
<div [ngStyle]="{'background-image' : imageresult.pictureUrl}"> some content here! </div>
回答1:
try this and be sure that you have added your assets in angular-cli.json
[ngStyle]="{'background-image': 'url(' + imageresult.pictureUrl+ ')'}"
来源:https://stackoverflow.com/questions/50037590/angular4-background-image