Http POST请求Ionic3 - 重新加载数据

时间:2017-09-08 14:04:35

标签: angular ionic3

您好我有[{1}}个应用,工作宽度ionic3宽度为http POST request,我的功能效果很好,只需要重新加载数据。

例如:

  • 我点击api.php example并向服务器发送请求。
  • 服务器必须返回某些数据(如果我将再次切换到其他页面,这会有效)

我想显示数据立即,不想退出当前页面,然后再返回...

任何想法?任何解决方案谢谢!

数据api页面:

function

其他页面

  public sendMessage(token, to, message, attachment){
    return this.http.post(this.sharedVars.getApi(),"action=messages/send&token="+token+"&to="+to+"&message="+message+"&attachment="+attachment, this.options
    ).map(res => res.json());
  }

SendMessage页面:

  sendMessage(id){
     let sendMsg = this.popoverCtrl.create('SendmessagePage',{data:id},{cssClass: 'comment-popover'});
     sendMsg.present();
  } 

0 个答案:

没有答案