Forwarding Controllers


#1

Hi, I have a class Action, wherein I need several Controllers like AlertController, ModalController, ToastController, … I put them all in the constructor like in the tutorials shown, so far so good.

Now I have a Component wherein I create some Objects of Action. I do this by new Action(...);
The Problem now is, that I have to forward all the Controllers to the constructor of Action by new Action(this.alertCtrl, this.modalCtrl, this.toastCtrl); and therefore I also have to include all those Controllers to the Constructor of the Component where I want to use the class Action.

Is there any other way to avoid putting those Controllers to the Constructor of the class and to avoid so those long long lines of codes for just generating a new Instance of Action?