navigator alert function working after second time

Viewed 175

I have a button when clicked i do this function:

$scope.sendPolicy = function(){
    // make server request and called this call back:
    navigator.notification.alert(
        "message",
        function(){
            $state.transitionTo('main', {
                Id: $scope.Id
                });
        },
        'title',
        'confirm');

the alert pops up ok, but when the confirm button is clicked, the alert dissappears, and thats it. nothing else happens (a transition to the main screen should be triggered.) after the alert was dismissed, if the button that caused the alert to pop is clicked again, the view / page transfer is being trigered, and we pop back to the main page, and as well, the alert pops back again.

the issue is:

  1. why the confirmation button does not trigger the pop back / transfer to main screen.
  2. why another click on the button causes the pop / transfer?
  3. why does this extra click trigers the alert again?
1 Answers
Related