$scope.PrintOWTickets = function (TicketNo, MobilNo) {
$http({
method: "GET",
url: $scope.ip + '/getPrintTicekt?TicketNo=' + TicketNo + '&PassengeMobile=' + MobilNo + '&PassengeEmail=' + MobilNo + '&ClientId=' + $scope.clientidFromFactory + ''
}).then(function (response) {
$scope.PrintOW = response.data;
if (response.data.error == 1) {
alert("Error");
}
else {
function1(); // if it is success then call function2
function2();
}
})
};
I want to call the second function if the first function returns true.