Modal issues in Ionic 2


Hello guys! I am just discovering ionic 2 and got to a little issue. I want to create a modal in ionic 2, but somehow the create in Modal.create(LoginsuccessPage); gets underlined. It says:

Property 'create' does not exist on type 'typeof Modal'.

Here is the full home.ts file:

import { Component } from '@angular/core';

import { NavController, Modal, NavParams } from 'ionic-angular';
import { LoginsuccessPage } from '../loginsuccess/loginsuccess'

  selector: 'page-home',
  templateUrl: 'home.html'
export class HomePage {

  constructor(public navCtrl: NavController) {


    let modalPage = Modal.create(LoginsuccessPage);

    this.navCtrl.push(LoginsuccessPage, {
      myString: "Simon"

Any idea what went wrong here?


you need to instantiate the modalCtrl via dependency injection --> like NavController in your code.


It worked! Thank you! :slight_smile: