An example of one of my $ http requests in AngularJS (the structure of the others is similar)
$scope.getCurrentCareers=function () { var promise = $http({ url: basePath + "/studentreg/getcurrentcareers", method: "POST", headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'} }).then(function successCallback(response) { $scope.currentCareers=response.data; }, function errorCallback() { console.log("error"); }); return promise; }; In the controller, I need to call three different services so that they run in parallel, and after the last of them (in time) receive the answer, call the 4th function.
angular.element(document).ready(function () { $scope.getCurrentCareers(); $scope.getCurrentSpecializations(); $scope.getCurrentCountryCity(); // после последнего ответа вызвать функцию $scope.myFunction(); .then( function () {$scope.myFunction(); )}; )}; Tell me how to do it right?