0
I have a list of products, clicking on some of them, redirects to another page showing only the content of this item. I receive the Image, but I would like it to be in the background, that is, it will show the same image in large size, and with text and etc written on top. Is it possible from my HTML I set the image as background? Because to receive it I am using <img src="{{produto.nom_pathimagem}}" class="bgimage" >
. So I can’t set a default value in scss. Thanks for any help :D
did not work. On my way in the database to receive the images is:
assets/imgs/id-1.png
. So in html I’m using<img src="{{produto.nom_pathimagem}}" class="bgimage" >
. I tried your solution but nothing came up. You know what can be?– Felipe XST
checked in the console?
– Douglas
I get this: WARNING: sanitizing unsafe style value background-image:url('Assets/imgs/id-1.png') (see http://g.co/ng/security#xss).
– Felipe XST
It is possible through scss I set the background-image dynamically?
– Felipe XST
At angular 6.1 running on localhost here worked. try using ng-style instead of style.
– Douglas
ng-style="{'background-image':'url(/{{ product.pathfigure }})'}"
– Douglas
Error: Cannot find a differ supporting Object '{'background-image':'url(/Assets/imgs/id-1.png)'}' used
<div ngStyle="{'background-image':'url(/{{ produto.nom_pathimagem }})'}"></div>
– Felipe XST