我正面临这个问题。我试图打开一个模态对话框,在角材料。下面是代码:
html:
<button class="btn-image" (click)="openDialog(element.batchId)">
。ts文件:
constructor(private matDialog: MatDialog) { }
openDialog(batchId:number) {
this.batchId = batchId
this.matDialog.open(WavedetailsComponent, {
height: '75%',
width: '75',
panelClass: 'full-screen-modal',
data: { batchId:batchId}
})
问题是,对话框出现在当前屏幕下方,而不是当前屏幕上方。谁能告诉我,哪里出错了?
把它放到你的styles.css或styles.css文件中
.cdk-global-overlay-wrapper, .cdk-overlay-container {
z-index: 99999 !important;
}