Skip to content

ionViewDidLoad() not working in Modal #8414

@dhndeveloper

Description

@dhndeveloper

Note: If you are having problems formatting your issue please refer to this article on using markdown in Github:

https://guides.github.com/features/mastering-markdown/

Note: for support questions, please use one of these channels:

https://forum.ionicframework.com/
http://ionicworldwide.herokuapp.com/

Short description of the problem:

ionViewDidLoad() not executing in Modal

What behavior are you expecting?

I'm expecting a log from the Push Page 'Hello Push Page'

Steps to reproduce:

  1. Generated a blank app
  2. Modified home page to:
import { Component } from '@angular/core';

import { NavController, ModalController } from 'ionic-angular';

import { Push } from '../push/push';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  constructor(public navCtrl: NavController, public modalCtrl: ModalController) {

let createModal = this.modalCtrl.create(Push);

createModal.onDidDismiss( data => {

});

createModal.present(createModal);

  }

}
  1. Push Page:

`
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';

/*
  Generated class for the Push page.

  See http://ionicframework.com/docs/v2/components/#navigation for more info on
  Ionic pages and navigation.
*/
@Component({
  selector: 'page-push',
  templateUrl: 'push.html'
})
export class Push {

  constructor(public navCtrl: NavController) {}

  ionViewDidLoad() {
    console.log('Hello Push Page');
  }

}

`

insert any relevant code between the above and below backticks

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

Which Ionic Version? 1.x or 2.x

Ionic Framework Version: 2.0.0-rc.0

Plunker that shows an example of your issue

Run ionic info from terminal/cmd prompt: (paste output below)

Cordova CLI: 6.3.1
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
ios-deploy version: 1.9.0
ios-sim version: Not installed
OS: Mac OS X El Capitan
Node Version: v6.7.0
Xcode version: Xcode 8.0 Build version 8A218a

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions