离子 - 发送组件作为参数

时间:2018-02-15 07:22:16

标签: angular typescript ionic-framework

我有一个包含许多页面的离子应用程序,每个页面都有一个过滤器按钮,用于打开带有类别复选框的过滤器弹出窗口。当您单击复选框时,我想刷新背景组件而不关闭弹出窗口。我正在尝试做这样的事情,但得到this.Page.Refresh() is not a function

SalesPage.ts

export class SalesPage {    
        OpenFilterCat()  // WHEN YOU CLICK THE FILTER BUTTON  
            let popover = this.popoverCtrl.create(CategoryPopover,
                                {
                                    Page: this
                                });
                            popover.present({
                                ev: event
                            });

            }
        Refresh()
        {
           //REFRESH COMPONENT SERVER SIDE HTTP CALL
        }

        }

CustomersPage.ts

export class CustomersPage{    
    OpenFilterCat()    
        let popover = this.popoverCtrl.create(CategoryPopover,
                            {
                                Page: this
                            });
                        popover.present({
                            ev: event

              });  
    }
    Refresh()
    {
       //REFRESH COMPONENT SERVER SIDE HTTP CALL
    }
}

Category.ts

export class CategoryPopover {
    Page: any;

    constructor(public viewCtrl: ViewController
        , public modalCtrl: ModalController
        , public navParams: NavParams
        , public events: Events) {

        this.Page = this.navParams.get('Page');

}
     RefreshBackground() // AFTER CHANGING SOME CHECKBOXES REFRESH THE BACKGROUND
       {
          this.Page.Refresh();
       }
}

0 个答案:

没有答案