I have updated my application from angular 4.4 to angular 5.2 by updating package.json file but getting this error Uncaught Error: Can't resolve all parameters for DialogService: (?, ?, ?)
Dialog-service.ts is below
import {Injectable, Component} from '@angular/core';
import {MatDialog, MatDialogConfig, MatDialogRef} from '@angular/material';
import {ConfirmService} from './confirm.service';
import {GuideService} from '../guides/guides.service';
@Injectable()
@Component({
templateUrl: 'dialog.component.html',
styleUrls: ['confirm.component.scss']
})
export class DialogComponent {
constructor(private confirmService: ConfirmService,
private guideService: GuideService,
private dialogService: DialogService) {
this.msg = confirmService.msg;
this.guideService.isConfirmBoxOpen.next(true);
}
public msg: string;
closeDialog() {
this.dialogService.dialogRef.close();
}
continue() {
this.guideService.isConfirmBoxOpen.next(false);
this.dialogService.dialogRef.close('continue');
}
}
export class DialogService {
dialogRef: MatDialogRef<DialogComponent>;
constructor(private mdDialog: MatDialog,
private confirmService: ConfirmService,
private guideService: GuideService) {
}
confirm(message?: string) {
this.guideService.isConfirmBoxOpen.next(true);
this.confirmService.options = {
ok: false,
yes: true,
cancel: true
};
return new Promise<boolean>(resolve => {
this.dialogRef = this.mdDialog.open(DialogComponent, <MatDialogConfig>{
height: '350px',
width: '700px',
});
this.dialogRef.afterClosed().subscribe((value) => {
if (value === 'continue') {
return resolve(true);
} else {
return resolve(false);
}
});
});
}
}
I have already tried many versions of angular material and angular other versions, but couldn't find any solution. Is there anything wrong with dialog-service or angular material version 5.2.5 . I am using angular 5.2.10 with material 5.2.10 . Can anyone please help?