Background image in ngStyle does not display on iPhone devices


#1

I have a dynamic background image which I set using ngStyle in the html code. However, the images do not display on iPhone devices. (the following code works on Android devices, Android emulators and ionic lab)

[ngStyle] = "{'background': 'url(../assets/img/backgrounds/'+currentTheme+'.jpg)'}"> 

What would the appropriate pathing of the url be? Has anyone else encountered this problem and found any solution for this?


#2

Use <div [style.backgroundImage]="'url(assets/img/backgrounds/' + currentTheme + '.jpg)'"></div> and replace ../assets with assets