Doing something after switching the page

Hi,
I was wondering how to set up a page to, for example, run in .ts file this:

menu2() {
    this.menu.enable(true);
  }

Sorry for my amateur question, but Im new to Ionic. :smiley: