I have two functions which has ajax calls inside them.
function a(){
ajaxCall_A();
}
function b(){
ajaxCall_B();
}
And I
Make sure that ajaxCall_A() and ajaxCall_B() return promises, and add returns to a() and b().
function a(){
return ajaxCall_A();
}
function b(){
return ajaxCall_B();
}
Then, a() and b() will execute sequentially as follows :
function c() {
a().then(b);
}
You should also add a return to c() so it returns a promise to its caller.
function c() {
return a().then(b);
}