Trying to figure out why when the console tells me one thing but angular's output to html tells me another.
Code
angular.module('global',[]);
angular.module('global').controller('thisTestController', thisTestController);
function thisTestController() {
var tc = this;
tc.status = "not loaded";
function activate() {
var background = new Image();
background.onload = function () {
tc.status = "loaded";
console.log(tc.status);
};
background.src = 'http://placehold.it/350x150';
}
activate();
}
HTML
<body ng-app="global">
<div ng-controller="thisTestController as tc">Status = {{tc.status}}</div>
</body>
Result
Console.log - loaded
HTML - Status = not loaded