With a model hierarchy like this:
export class A {
constructor() {
// Here service X is needed for some own functions
}
}
export class B extends A {
constructor() {
// Here service Y is needed for some own functions
super( ... )
}
}
export class C extends B {
constructor(parent, data) {
super( ... )
}
}
I want to instance C objects. So the questions are:
How do i inject X and Y services?
- Should i put all of them on the
Cconstructor, and pass them to the base classes withsuper? - Can they be mixed with the already existing parameters
parentanddata? - There is some way i can inject only
Yat theBlevel, andXat theAlevel? So somehow i avoid passing those references on thesuper?