Ordering multiple IonicModals on top of each other

前端 未结 4 1884
醉话见心
醉话见心 2021-01-18 21:56

The usage of the $ionicModal service is explained here: http://ionicframework.com/docs/api/service/$ionicModal/

I have a situation where it happens that I open more

4条回答
  •  情话喂你
    2021-01-18 22:13

    You can solve by hiding the modal you don't want to be on top, for example:

    function showSignupModal() {
       if ($scope.loginModal.isShown())
          $scope.loginModal.hide();
       $scope.signUpModal.show();
    }
    

    However, if you want to keep the loginModal open in background for some reason, you can open and close the loginModal beforehand this way:

    function showSignupModal() {
       if (!$scope.loginModal.isShown())
          $scope.loginModal.show();
          $scope.loginModal.hide();
       }
       $scope.signUpModal.show();
     }
    

提交回复
热议问题