如何在md-dialog上叠加md-dialog

时间:2016-08-02 15:44:02

标签: javascript angularjs angular-material mddialog

我试图从打开的对话框打开一个md对话框,但问题是第二个打开时第一个md对话框已关闭

// the controller of the first popUp 
class popUpOneController{
      constructor($mdDialog){
      this.$mdDialog=$mdDialog;
       .
       .
       .
       } 
  others methods codes......
// the second $mdDialog to be opened from the  first 
// this function will be executed by clicking  on a html  button
  openPopUp2(){
      // here we call a component into the $mdDialog
      this.$mdDialog.show({
            template: '<interlo-sibel  data-to-pass='+data+'  index-selectedElm='+index+' type='+type+' ></interlo-sibel>',
            targetEvent: event,
            escapeToClose: false

        })
   } 
   popUpOneController.$inject=['$mdDialog'];


 export default popUpOneController

1 个答案:

答案 0 :(得分:3)

我找到了答案,我们刚刚添加以下attiribute'skipHide:true'

 openPopUp2(){
      // here we call a component into the $mdDialog
      this.$mdDialog.show({
            template: '<interlo-sibel  data-to-pass='+data+'  index-selectedElm='+index+' type='+type+' ></interlo-sibel>',
            targetEvent: event,
            skipHide: true


        })
   } 

plunker上的演示链接:https://plnkr.co/edit/jaDD79A1JII4XKhXP64Y?p=preview

相关问题