@skyrocket777 wrote:
Hi there! I wonder if it is possible that a method of a service function like in my example calls a method inside itself. Like Alert AskYesNo can call showAlert function (method). I have try using this.showAlert for example. But sends an error message. I also have tried Alert.showAlert and the same.This is just an example, I have a more complex service function with the same problem. Can you help? thank you a lot
.factory('Alert',function($http, $ionicPopup){ return { showAlert:function(title,template) { $ionicPopup.alert({title:title,template:template}); }, AskYesNo:function(title,template) { return $ionicPopup.confirm({title:title,template:template}).then(function(res) { if (res) { Alert.showAlert("DoSomething","Here");//HOW CAN I CALL HERE? } }); } } })
Posts: 1
Participants: 1