I created such a class
@Injectable FooService {
constructor(private _bar:BarService){
}
}
And extended it like this
@Injectable ExtFooService extends FooService {
constructor(private _bar:BarService){
super(_bar);
}
}
In this way I get the following error:
Error:(12, 14) TS2415:Class 'ExtFooService' incorrectly extends base class 'FooService'. Types have separate declarations of a private property '_bar'.
Why is that so?
I tried removing the injections from the ExtFooService, but I get this at the super()
line:
Error:(21, 9) TS2554:Expected 2 arguments, but got 0.
Is it really necessary that I do this?
@Injectable ExtFooService extends FooService {
constructor(private _extBar:BarService){
super(_extBar);
}
}