I have a component which is meant to be used in an Angular Material MdDialog :
@Component({ ... }) export class MyComponent { constructor(@Inject(MD_DIALOG_
You can use Angular Optional decorator, I faced this problem before so
if the component is not used as a popup try this snippet
constructor( @Optional() public dialogRef: MatDialogRef, @Optional() @Inject(MAT_DIALOG_DATA) public data: any ) {}