Problem with background after call popup more than once


#1

Hello guys I have the following code

var showmsg= function() {
      var confirmPopup = $ionicPopup.confirm({
        title: 'Internet connection,
        template: 'Turn on your internet connection',
        buttons: [
          { 
            text: 'Cancel',
            onTap: function() { ionic.Platform.exitApp();  }
          },
          {
            text: '<b>Ok</b>',
            type: 'button-positive',
            onTap: function() { 
              if ($cordovaNetwork.isOnline()==false)  {
                showmsg();   
              }
            }
          }
        ]
      });
    }

    // $cordovaNetwork.isOnline()
    if ( $cordovaNetwork.isOnline()==false ) {
      showmsg();
    }

I want to show a confirm button as long as the person tab the cancel button or turn on his internet connection. But after the first tab on Ok button the popups is ok, but the background is not black anymore.