2017-04-27 37 views
2

我使用MdlDialogService從我家組件打開幫助對話框:Angular2 mdldialogservice滾動內容

openHelpDialog(){ 

    this.dialogService.showCustomDialog({ 
     component: HelpComponent, 
     animate: true, 
     isModal: true, 
     styles: {'width': '500px', 'overflow-y':'scroll'}, 
     clickOutsideToClose: true 

    }) 
} 

而且在我的應用程序組件:

<app-home></app-home> 
<dialog-outlet></dialog-outlet> 

現在,當我有很大的幫助內容然後模態高度簡單地切碎:

enter image description here

如何將高度限制爲特定百分比,然後使用滾動查看內容?

回答

0

我只是說最大高度風格類似以下內容:

this.dialogService.showCustomDialog({ 
     component: HelpComponent, 
     animate: true, 
     isModal: true, 
     styles: {'width': '500px', 'max-height':'500px' ,'overflow-y':'scroll'}, 
     clickOutsideToClose: true 

    })