簡體   English   中英

離子如何從另一個頁面運行一個頁面的 function

[英]Ionic how to run function of a page from another page

我有 2 頁。 我需要的是當我單擊頁面上的按鈕時,我需要運行其他頁面的 function。 基本上1是頁面,其他是彈出窗口。 我需要當用戶單擊彈出頁面按鈕時 function 將運行。

 export class Page {
     constructor() {}

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

   export class popup{
    constructor() {}

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

我知道可以通過創建服務來實現,但不想通過服務來實現

運行第二頁ngOnInit

ngOnInit() {
    yourFunction();
  }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM