In my code I am calling this function loadAllOrders();. This is the skeleton of its implementation,
$scope.loadAllOrders = function() {
orderSvc.GetAllOrders().then(function(response) {
// Does a bunch of stuff here
});
}
GetAllOrders() uses a $http to get data from a database. loadAllOrders() then formats all the data and inserts them into an ng-repeat.
I want to be able to call a function when loadAllOrders() has finished. For example,
$scope.loadAllOrders().then(
//I am doing something
);
How can this be achieved?
promiseto achieve this