Basically i have a link, and when it\'s clicked, i display a modal. Now i can display other properties on the modal like title except the background Image ! urghhh !
Correct syntax for background-image is:
background-image: url("src");
Correct syntax for ng-style is:
for example :
JSFiddle : http://jsfiddle.net/U3pVM/7194/
also You can use custom directive :
app.directive('backgroundImageDirective', function () {
return function (scope, element, attrs) {
element.css({
'background-image': 'url(' + attrs.backgroundImageDirective + ')',
'background-repeat': 'no-repeat',
});
};
});
for example :
JSFiddle : http://jsfiddle.net/U3pVM/7193/
Update :
which would not attempt to fetch a non-existing image.