40
rated 0 times
[
47]
[
7]
/ answers: 1 / hits: 92420
/ 6 Years ago, tue, march 27, 2018, 12:00:00
I am learning Angular (which is written in TypeScript) and I stumbled upon this error:
Class 'SnackbarService' incorrectly extends base class 'MatSnackBar'.
Types have separate declarations of a private property '_overlay'.
when trying to extend MatSnackBar
from @angular/material
.
This is my code:
import { MatSnackBar } from '@angular/material';
import { Overlay } from '@angular/cdk/overlay';
import { LiveAnnouncer } from '@angular/cdk/a11y';
...
export class SnackbarService extends MatSnackBar {
constructor(
private _overlay: Overlay,
private _liveAnnouncer: LiveAnnouncer,
...
) {
super(_overlay, _liveAnnouncer, ...);
}
}
}
Any help with any type of explanation on why this happens would be really be appreciated.
More From » typescript