I am trying to achieve dynamic styling for a div in lightning using expression syntax and back-ground image but i am not able to load my image. how ever, if i point it with the below syntax
background-image:url(/resource/Houseboats/houseboat2.png)
I am able to see the image saved in static resource, as below.
Any suggestions on how to write the correct syntax.
I tried the following syntax, nothing seems to load the image correct, i here by attach the network tabs response and status, no errors in the console. All the requests got 200 status except one which says pending please find that below. I am new to debugging networks tab, any suggestions on where exactly to look to debug this kind of errors is welcome.
<div style="{!'background-image:'+v.boat.Picture__c}" class="innertile">
<div style="{!'background-image:'+'url(v.boat.Picture__c)'}"
class="innerTile"/>
To Reproduce this issue feel free to load any zip file a test image in static resource and try to save the resources path( static resource) in a field for example(resources/catzip/cat,jpeg) in any object and try to render it as background-image in a div tag.
FYI
I am able to retrieve correct values from fields, as you can see the image above has correct names for each boat. I even tried to display {v.boat.Picture__c} i am able to get the values stored in the field.