mercredi 8 février 2017

Ionic 2 img in ngStyle in html wont show up on device

Vote count: 0

My image is located in src/assets/img/..

in my html which is located in src/pages/myPage/myPage.html. I try to set a background image like so

<div [ngStyle]="{
      'background-image': 'url(assets/img/..)'
    }">
</div>

I have also tried

'background-image': 'url(../assets/img/..)'

'background-image': 'url(/assets/img/..)'

I have also been google-ing and I came across this but I still can't get it to work on my device

However, they show up when I serve using ionic serve and emulate using ionic emulate android --livereload

Please help!

asked 38 secs ago

Let's block ads! (Why?)



Ionic 2 img in ngStyle in html wont show up on device

Aucun commentaire:

Enregistrer un commentaire