Setting the background image of a page using CSS:
body {
background: url(http://momentumbooks.com.au/wp-content/uploads/2013/06/space.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
text-align: center;
}
Looking to read a property from a scoped variable in the controller:
$scope.image="http://momentumbooks.com.au/wp-content/uploads/2013/06/space.jpg"
How to set this CSS body attribute within the .html page with AngularJS? jQuery's .css() method is not working. Is there an alternative in AngularJS? http://docs.angularjs.org/guide/dev_guide.templates.css-styling doesn't provide clear instructions.
Here is a fiddle that I tried but it does not work:
http://jsfiddle.net/U3pVM/3015/
Fiddle code:
<body ng-style="getBodyStyle()">
</body>
$scope.getBodyStyle = function () {
return {background: "url(http://momentumbooks.com.au/wp-content/uploads/2013/06/space.jpg) no-repeat center center fixed;"};
};