I have a parent class where I want to inject some modules, then I have some derived classes where I would like to use these injected modules.
However in the derived class you have to call super()
without parameters, so injected modules in parent class are undefined.
How could this be done?
import {inject} from 'aurelia-framework';
import {HttpClient} from 'aurelia-http-client';
@inject (HttpClient)
export class Parent{
constructor(module){
//this constructor is called from derived class without parameters,
//so 'module' is undefined !!
this.injectedmodule = module;
}
}
export class ClassA extends Parent{
constructor(){
super();
this.injectedmodule.get() // injectedmodule is null !!!
}
}