It seems I can not use the controller to set the CSS background property for the div. Here is my code so far, as per the documentation:
HTML:
<div class="hero" ng-controller="HeroCtrl" ng-style="heroImage"></div>
JS:
'use strict'; angular.module('AppliedSiteApp').controller('HeroCtrl', function ($scope) { $scope.heroImage = { background: 'images/brick.jpg' }; console.log($scope.heroImage); });
CSS
.hero { width: 100%; min-height: 350px; background-position: center center; }
I also tried to reproduce this setting in Fiddle here . Does anyone have any ideas?
source share