Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70435

Ionic 3, push page after successful http post

$
0
0

@leorjoseph wrote:

I have been trying so hard to make this work, not sure why this is not working. Below is the code which am using,

import {Http, Response, RequestOptions, Headers} from "@angular/http";

  loginCompleted() {
    console.log("loginCompleted()");
    this.navCtrl.push(TabsPage);
  }

login(callback) {
this.http
      .post("", body.toString(), options)
      .subscribe(function(response) {
        console.log("Login Response",response);
        this.loginResponse = JSON.parse(response.text());
        callback
      });
}

Am trying to make a simple HTTP Post call and based on the response I want to push the TabsPage. But whats happening is Tabs page is getting pushed immediately after the HTTP post call is made. Can anyone tell what is the problem.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>