nullinjectorerror no provider for matdialogref angular 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
],
...