Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular MatDialog appends to HTML instead of showing as a popup

I am following on an Angular MatDialog tutorial on Youtube(https://www.youtube.com/watch?v=xJJ_NDqvuCk) and did exactly the same as instructed. However, the popup seems not working properly. how can i make the popup shows in the middle of the screen instead of appending to the bottom of HTML

How it shows

Code where dialog is implemented

Component template of dialog

like image 840
Shayne Song Avatar asked Sep 12 '25 13:09

Shayne Song


1 Answers

Did you import a theme?

Add the following line to styles.css/styles.scss/your main CSS file:

@import '~@angular/material/prebuilt-themes/indigo-pink.css';
like image 175
Edric Avatar answered Sep 14 '25 04:09

Edric