My custom background image is not showing up in AngularJS. Can't figure out why.
When I test $scope.setBackground in console, I get Object {background-image: "url(image.jpg)"}
Controller:
app.controller('backgroundImageCtrl', function($scope, $http) {
$scope.setBackground = {
'background-image' : 'url(image.jpg)'
};
})
HTML:
<script type = "text/ng-template" id="/page.html" ng-controller="backgroundImageCtrl" ng-style="setBackground">
<div>
...
</div>
</script>
background-imageis on thetemplatetag. It's should be on a inner element.scripttag. Also, as I know, the template engine take the inner content of thescripttag and put it wherever it should. So, those attributesng-controllerandng-stylewill not affect.