Saturday, June 9, 2018

Know when view load in ionic 2 | ionic 3 | ionic 4

Please add below code to detect view load in ionic :


export class SomePage {
  constructor() {
        // …
     }

     ionViewDidLoad() {
          // Put here the code you want to execute when view load
     }
}

ionViewDidLoad : Runs when the page has loaded. This event only happens once per page being created. If a page leaves but is cached, then this event will not fire again on a subsequent viewing. The ionViewDidLoad event is good place to put your setup code for the page.


No comments:

Post a Comment