Change page after http Service Response

I’m using Ionic 2 to create a app login. After the user inputs his credentials in a login form I start an angularJs http Service Request to my Api. On succesfully Response I want to change the page with this.nav.push(Page1);

import { Component } from '@angular/core';
import { NavController, Alert, Loading } from 'ionic-angular';
import { Authenticate } from '../../providers/authenticate/authenticate';
import { Page1 } from '../page1/page1';

         templateUrl: 'build/pages/start/start.html',
         providers: [Authenticate]

        export class StartPage {

            public authenticate: any;
            constructor(private nav: NavController, public authService: Authenticate) {
                    this.nav = nav;


                  .then(function successCallback(response) {

                  }, function errorCallback(response) {

It works fine if I call the change page before the (async ?!) Request but if I put it in successCallback it gives me this error:
Unhandled Promise rejection: Cannot read property 'nav' of null ;

Thanks for helping :slight_smile:

  .then((response) =>{
  }, (response) => {

use => “fat arrow” to maintain and bind to the component so this will work inside of the scope of the then block

Thanks now it works :slight_smile: