Style="background-image: url(' {{ foo.url }} ' );" works on web not in ionic


#1

Working on web:

That same code doesn’t work in an ionic app though. Has anyone experienced this and how did you get around it?

Note: the only difference from the web code and my mobile code is that it’s wrapped in <ion-content> and <item-collection> like this:

<ion-content>
  <item collection-repeat ...>
    <div class='foo' style='...

#2

We’ll need a lot more information:

What devices did you try? Was this working in your browser? Is the URL an external link or are you planning on using an internal resource? Have you checked that the Url is whitelisted?

We don’t have much to use to help you out, a full code pen or full chunk of code is really helpful. Just that much doesn’t do us anything good.

Where is the background in the code and what element is it attached to?


#3

I’m wrong, I was using ng-style instead of style=. It works!