ionic 3如何通过邮件获取数据

问题描述 投票:0回答:1

我如何通过邮件获取数据。我需要帮助。我的代码:

 getmapdetail(){
    return new Promise(resolve => {
      this.http.post(this.apiUrl, JSON.stringify({id:3})).subscribe(data =>{

        resolve(data);
      },err =>{
        console.log(err);
      });
    })
  }
angular post ionic3
1个回答
0
投票
// considering this is in some service
getmapdetail(){
    return this.http.post(this.apiUrl, JSON.stringify({id:3})).map(data => data.json());
}

// inject that service in component
// call that service from component like this
this.service.getmapdetail().subscribe(data => {
    // do what ever you want with data
})
© www.soinside.com 2019 - 2024. All rights reserved.