There are two separate HTTP calls on a page that need to be handled independently.
vm.$onInit = function() {
....
....
//Retrieve all items during initialization
ds.getAllItems().then(function(result){
vm.items = result;
},function(error){
vm.errorInApi = true;
});
.....
.....
}
vm.getTimes = function(){
.....
.....
HttpWrapper.send(url,{"operation":'GET'}).then(function(times){
.....
}
If both APIs fail, then I want to display a modal pop-up.
I can set a variable to true and if the API calls fail, I will change it to false before displaying the modal.
The question is how long to wait for both APIs to complete?