**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();
}
当我运行测试用例时,testcomponent
我得到以下信息
错误:“未找到 LoaderDialog 的组件工厂”。