android - Use two controller in the same page -


i'm making first app on ionic2 , i'm little confused typescript. display popup , modal on same page: have import modalcontroller , alertcontroller 'ionic-angular'. can use alerts following code:

import { alertcontroller } 'ionic-angular';  export class mypage {   constructor(public alertctrl: alertcontroller) {   } } 

or modal using following code:

import { modalcontroller } 'ionic-angular'; import { modalpage } './modal-page';  export class mypage {   constructor(public modalctrl: modalcontroller) {   } } 

but when want use two, have used 2 constructors it's impossible... correct way use these 2 components?

thanks in advance!

you can inject multiple providers in constructor.. this:

  constructor(public alertctrl: alertcontroller,public modalctrl: modalcontroller) { 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -