Ordering multiple IonicModals on top of each other

前端 未结 4 1882
醉话见心
醉话见心 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:01

    This is what I did to workaround this problem:

    First, define a css style for a class name

    .top-modal {
        z-index: 11;
    }
    

    Then modify the modal's class name by adding in top-modal during initialization

    $ionicModal.fromTemplateUrl('myTopModal.html', {
        scope: $scope,
        animation: 'slide-in-left'
    })
    .then(function (modal) {
        modal.el.className = modal.el.className + " top-modal";
        $scope.myTopModal = modal;
    });
    

提交回复
热议问题