AngularJS docs say:
$q promises are recognized by the templating engine in angular, which means that in templates you can treat promises attached to a
You need to use the then() function on the promise object:
this.getItem().then(function(result) {
$scope.item = result;
});
In your case I don't think you need a promise. Angular's $watch system will take care of things. Just return an object in your function, not a primitive type:
this.getItem = function () {
var item = {};
// do some async stuff
$http.get(...).success(function(result) {
item.title = result;
});
return item;
};
$scope.item = this.getItem();