Angular ng style image when url contains spaces
I am trying to apply a background image to a div using angular ng-style
and it works fine as long as the url contains no spaces.
ng-style="{'background-image': 'url(' + parentIMGLink + ')'}"
When there is a space in the url, for example parentIMGLink = servername.images/there is name.png
, it doesn't work. On the other hand:
img ng-src={{parentIMGLink }}
Works great. Of course, I can manage so that the names on the server do not contain spaces, but is there a way to do the ng-style work?
+3
source to share
2 answers