Hi, I'm trying to work with a tutorial about modal in angular 5 -> https://material.angular.io/components/dialog/overview
and it's not working it giving me the error
Can't bind to 'mat-dialog-close' since it isn't a known property of 'button'.
here is my HTML code:
Are you sure you want to delete the book {{data.title}} ?
thanks.
Did you import the MatDialogModule
? For example in your app.module.ts
file
import {MatDialogModule} from '@angular/material';
...
@NgModule({
declarations: [
...
],
imports: [
...
MatDialogModule,
],
WOW!!! that was the problem thank you very very much!! :)
I think you can close the issue as it is not Angular Material's fault ;).
If you're opening a dialog with dialog.open
in one module and your control is defined in another you must add the Dialog module import to both modules.
This is very easy to forget, and the dialog will open - it's just that then all dialog directives (including mat-dialog-actions / mat-dialog-title and mat-dialog-content will not work).
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
Did you import the
MatDialogModule
? For example in yourapp.module.ts
file