i am facing an issue. i have angularjs function which in turn call to another angularjs function which has post request.This post request always fire at last when first function ends..it is not fired sequntially.
pseudo code
$scope.fun1= function()
{
$scope.fun2();
console.log("after call to fun2"); // execute before fun2
}
$scope.fun2=function()
{
$http.post(valid request);///this always executed at last..means at end of function 1...no matter at what position i call it
}
Please someone explain me this behaviour..any workaround for this...i want to execute all http request sequentially. Thanks in advance!