Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71363

Creating Multi-template Modals (?)

$
0
0

@fOrtiz wrote:

Hello!

I am building my second application on Ionic, the first in v3. Something that is bugging me is that I am not sure how to use a single Modal class to every need in the app. Or if that is even possible. Does Ionic require us to define a Modal class for every different html resource?

Today I have something like this:

@Component({
    templateUrl: 'my_modal.html'
})
export class MyModal {

    private title: any;
    private message: any;

    constructor(params: NavParams, public renderer: Renderer, public viewCtrl: ViewController) {
        // this.renderer.setElementClass(viewCtrl.pageRef().nativeElement, 'my-popup', true);
        // this.form = FormData;
        this.title = params.data.title;
        this.message = params.data.message;
    }

    dismiss() {
        this.viewCtrl.dismiss();
    }

}

Thanks for your help.

Ortiz

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71363

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>