**testservice.ts**
import { LoaderDialog } from './loader.component';
import { MatDialog } from '@angular/material/dialog';
export class TestService {
constructor(public dialog: MatDialog) {}
dialogRef:any;
show() {
this.dialogRef = this.dialog.open(LoaderDialog, {
disableClose: true,
panelClass: 'transparent-background'
});
}
**testcomponent.ts**
constructor(private apiServ:ApiServeService, private dialog: MatDialog, private loader: TestService) {
this.loader.show();
}
when I run the test case for testcomponent
I'm getting the following
error: 'No component factory found for LoaderDialog'.