When dealing with multiple features in my ts file, I decided to split them into separate classes.
constructor(
) {
super(MatDialog);
}
Encountered error:
Argument of type 'typeof MatDialog' is not assignable to parameter of type 'MatDialog'.
Extending class:
export class AddClicnicComponent {
popTableSchema;
tableSchema;
@ViewChild('popupTemp', { static: true })
popupTemp: TemplateRef<HTMLAllCollection>;
constructor(public dialog: MatDialog) {
console.log('I am being called by the superclass');
}
handleAddClinic() {
this.popTableSchema = { ...this.tableSchema };
this.openDialog(this.popupTemp);
}
openDialog(templateRef: TemplateRef<HTMLAllCollection>) {
const dialogRef = this.dialog.open(templateRef);
dialogRef.afterClosed().subscribe((result) => {
console.log(`Dialog result: ${result}`);
});
}
}
What exact parameters do I need to send with super? Is it possible to avoid passing parameters altogether?