Questions tagged [mat-dialog]

145 questions
1
vote
1 answer

Angular 14 standalone component with Matdialog: ReferenceError: Cannot access 'x' before initialization on

Currently I'm working on Angular 14. on the upgrade process, the standalone component have problem with Matdialog and getting this issue: jsonp chunk loading:77 ERROR Error: Uncaught (in promise): ReferenceError: Cannot access…
Hiep Tran
  • 3,735
  • 1
  • 21
  • 29
1
vote
0 answers

Mat Dialog not displayed after upgrading to angular 13

I'm getting below 2 errors while trying to open mat dialog component. All the configuration is completely used as per the guidelines. But I'm not able to solve this error. core.mjs:6485 ERROR Error: NG0203: inject() must be called from an injection…
1
vote
1 answer

Angular 12 Material MatDialogConfig shadows on parent window does not disappear when close popup windows

I am using Angular 12 with Material... I have a main page with a mat-table. In the HTML I have an Edit() button inside the table and a create() button outside the table. This is the call .ts in the to the popup Windows. In both cases I call the same…
Diego
  • 2,238
  • 4
  • 31
  • 68
1
vote
0 answers

Dynamic Content Projection Angular MatDialog

Imagine a project structure like this: app --lazyModA ----ATable --lazyModB ----BTable --shared ----DialogWithTables We need to have a MatDialog in both lazyModA and lazyModB which are both lazy loaded which is able to display the MatTables ATable…
1
vote
0 answers

How to determine, if an Angular Component is opened as dialog?

I want to implement an Angular component, which can be opened both as a MatDialog, or displayed normally. If it's opened as a dialog, I want to display a close button for the user, to be able to close the dialog. To implement this, I have to inject…
1
vote
2 answers

Angular [mat-dialog-close]="false" does not work

Is there a certain reason, why [mat-dialog-close]="createFurtherCheckbox.checked ? 'false' : 'true'" does not work, if the value for [mat-dialog-close] is false? Within a dialog I create an object by clicking a submit button and if a certain…
AresianGTI
  • 13
  • 3
1
vote
0 answers

Is there a way we can create a mat-dialog upon an existing mat-dialog?

I want to create a second mat-dialog upon existing mat-dialog on the click of a button on the first mat dialog. Although the second mat-dialog is opening up, it makes the second one to disappear. Is there a way I can keep the first…
Prashant Sahu
  • 29
  • 2
  • 6
1
vote
1 answer

How to call a function after mat-dialog closed in Angular 12

I have a component called ListScheduleComponent it has a function that opens a mat-dialog with CreateScheduleComponent view: handleDateSelect(selectInfo: DateSelectArg) { this.fileNameDialogRef = this.dialog.open(CreateScheduleComponent, { …
jreloz
  • 413
  • 4
  • 18
1
vote
0 answers

An angular material modal MatDialog has no horizontal scroll bar

I open a matdialog with these parameters and I cannot see the horizontal scroll bar this.dialog.open(ModalComponent, { data: { isEditHistoric: true }, width: '500px', height: '40%' }).afterClosed().subscribe((result) => {}); My…
de guide
  • 35
  • 1
  • 8
1
vote
0 answers

mat-dialog error: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class

I'm trying to use dialog between two components, but the console keeps giving me this error. I've already tried to npm install again, but it didn't work. I've also tried to do what other questions suggest, but nothing worked. What I don't understand…
1
vote
2 answers

Calling the submit button of the form outside the form in angular

I have a form in angular which I use to add and edit the record. I want this submit button outside the form. I am using the mat dialog and want the submit button in the mat-dialog actions tag. The submit button that I place in the actions part of…
Ahmad
  • 89
  • 2
  • 15
1
vote
1 answer

How to mock a response from MatDialog sent from afterClosed in Angular unit tests?

I am trying to write some unit tests for MatDialog. What I am trying to do is to mock the response from the dialog and test, if it was correctly handled by the component. In my component, I should get a Map from the closed dialog and…
Kamil
  • 485
  • 1
  • 10
  • 24
1
vote
2 answers

NullInjectorError: No provider for x

Before this component was being loaded into MatDialog but now the requirement is to load it on some url i.e. http://localhost:4200/some-url and when I load this component via url and getting error NullInjectorError: No provider for x! Here is the…
WasiF
  • 26,101
  • 16
  • 120
  • 128
1
vote
0 answers

Angular Material Dialog: dialogRef.afterClosed() subscription not triggered

i am using material ui to open a component inside of a Mat-Dialog. When I close the dialog, my subscription to the dialogRef wont trigger. The parentComponent calls the editCatering() to open the dialog. parentComponent: import { MatDialog } from…
chrs
  • 11
  • 1
  • 3
1
vote
2 answers

How do I pass in Angular mat dialog box width and height?

I have this Mat dialog box in Angular and I understand I should pass in the styles for width and height alongside that object but I can't manage to figure out how, it keeps throwing errors. Or is there any other way to set width and height? Thank…
doctorprofessor
  • 105
  • 1
  • 2
  • 8
1 2
3
9 10