I have a service from which I am calling two functions in the controller. I want to check if the response of fucntionA is true and then only execute functionB
var result= functionA();
if(result === true){
functionB();
}
The if statement is already being executed without recieving the response from functionA and thus is always showing as false even when it should be true Note: functionA has an API call which is done using $http.get()