离子如何从另一个页面运行页面的功能

时间:2020-04-24 08:58:48

标签: angular ionic-framework

我有2页。我需要的是当我单击页面上的按钮时,我需要运行其他页面的功能。基本上1是页面,其他是弹出窗口。我需要当用户单击弹出按钮时页面功能才能运行。

 export class Page {
     constructor() {}

     callthis(){
       console.log('abc');
     }
  }

   export class popup{
    constructor() {}

      click(){
          here need to call that callthis();
      }
  } 

我知道可以通过创建服务来实现,但不想通过服务来实现

1 个答案:

答案 0 :(得分:0)

运行第二页 ngOnInit

ngOnInit() {
    yourFunction();
  }