I need to make two http.post() calls from angular controller and the result of the first one is to be used in the next call. The next call should not be made until and unless we receive the result of previous one. This whole logic needs to be repeated over a loop.
Logic---> for 1 to 5 function1-->http.post(object1) returns a deferred promise with data e.g. id1 Use the id1 as parameter for next call object2.id=id1 function2--->http.post(object2) returns some data.