Dealing with an http call in my controller, where I am loading a json file, seems easy but hasn't been so far. Despite successfully updating the variable (console.log) in JS, it doesn't reflect in the html. Is there a way to incorporate $apply or similar to update the result? Any other suggestions? Here's a (not) working plnkr
JS:
function SomeController($http){
this.someValue = 'initial';
$http.get('test.json').then(function (data) {
this.someValue="changed";
console.log("get request "+this.someValue);
});
}
app.controller('someController', SomeController);
HTML:
<div ng-controller="someController as some">
<p>{{some.someValue}}</p>
</div>