NullInjectorError: No provider for MatDialog! code example
Example: NullInjectorError: No provider for MatDialogRef!
import {DialogService} from './services/dialog.service';
import {MatDialogModule, MatDialogRef} from '@angular/material/dialog';
...
imports: [
...
MatDialogModule
],
providers: [
{
provide: MatDialogRef,
useValue: {}
},
DialogService
],
...