Reputation: 793
Am getting "NullInjectorError: No provider for MatDialog", below is the code
Open stackblitz link and click on orders link
https://stackblitz.com/edit/tms-prototype
Upvotes: 0
Views: 5722
Reputation: 214017
You should import MatDialog
from the same place where you have imported MatDialogModule
since they represent different bundles.
So use:
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
^^^^^^^
instead of
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
because you imported MatDialogModule
in SharedModule
from @angular/material/dialog
Upvotes: 4