Sorry if this is very simply, i just started using angular yesterday. I want to set a class of something to a variable, yet it isnt working. This is what i've done:
<body ng-app="Witzle" ng-controller="BGController" class="{{bg.type}}">
and
app.controller('BGController',function($scope){
$scope.bg = {type:'witzle-bg-image'};
$scope.gah = function(name){
alert(name)
$scope.bg = {type:name};
}
})
Ive run the code, and i know that $scope.gah() is being called because of the alert, but the class isnt being updated.
UPDATE: gah is already being called from somewhere else, my problem is that when it is called the class doesnt change