I am new to Angular, so this will be easy to most. I have a service with one function:
.factory('HttpHandler', function () {
return {
loadData: function (promise) {
var self = {
data: [],
loading: true,
promise: promise
};
promise.then(function (data) {
self.data = data;
self.loading = false;
});
promise.finally(function () {
self.loading = false;
});
return self;
}
};
});
What I would like, is to be able to run something else after this has completed successfully. Seudo code:
var result = httpHandler.loadData(httpCall, function (complete) {
console.log('this has completed');
});
Can someone explain to me how I can do this?
selfobject for at all. It seems to do not much more than the promise alone?