小编Osc*_*Paz的帖子

如何从角度2中的回调函数调用父函数?

这是一堂课

export class ChatDetailPage {

constructor(){

}

funcA(){
     var options = {
        onSubmit: function (text) {
        //i want to be able to access funcB from here 
        this.funcB(text)
          },
this.nativeKeyboard.showMessenger(options)
}

funcB(text){
  alert (text);
}

}
Run Code Online (Sandbox Code Playgroud)

在这种情况下,我如何从Anular 2或Ionic 3中的onsubmit回调函数调用funcB.

提前致谢.

typescript ionic2 angular2-components ionic3 angular

1
推荐指数
1
解决办法
1894
查看次数