Angular4 background image

拟墨画扇 提交于 2019-12-24 12:13:56

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!