I have a component (ItemDetailsPage) that is importing a helper service
import { Helper } from './../../app/Helper';
and in the constructor I have
constructor(public viewCtrl: ViewController, public navCtrl: NavController, public navParams: NavParams,
public helper: Helper...)
In Helper.ts I have the following:
import { ItemDetailsPage } from './../pages/item-details/item-details';
and I use it like that:
showItemWindow() {
let itemModal = this.modalCtrl.create(ItemDetailsPage, null, { cssClass: "modal-fullscreen" });
itemModal.present();
}
When doing the above, I get "cannot resolve all parameters for ItemDetailsPage... I understand that it's because of a circular dependency. I can move showItemWindow
to another component and it works but the reason I put it in the helper, is because I need it from 3 different pages and I wanted one place to open this window.
Is there another cleaner solution for this or moving it to 3 different component is the right one? Thanks