Angular Material: How to position MatDialog relative to element?
问题 I am developping an angular application. I want to open a dialog pop up (an instance of MatDialog) when I click on a button. I do it in a method of my main page as the following openDialog(event) { const element = document.getElementById(event.target.id); const jqelement = $(element); const position = jqelement.position(); // cache the position const bottom = position.top + jqelement.height(); const dialogConfig = new MatDialogConfig(); dialogConfig.disableClose = true; dialogConfig.autoFocus