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

How does one debug nav?

$
0
0

@raytri wrote:

Hey all,

I have been really struggling with the navigation the past couple of days, I just cannot get navigation to switch from a menu on mobile, even after looking at the starter project at great length.

I am now trying to debug it on the iphone, but when I run:

  openPage(page: PageInterface) {
		console.log(page);
    // the nav component was found using @ViewChild(Nav)
    // reset the nav to remove previous pages and only have this page
    // we wouldn't want the back button to show in this scenario
      this.nav.setRoot(page.component).catch((err) => {
				let alert1 = this.alertCtrl.create({
					title: "Nav Error",
					subTitle: "There was a navigation error, it will follow.",
					buttons: ['Dismiss']
				});
				alert1.present();
				let alert2 = this.alertCtrl.create({
					title: "Nav Error",
					subTitle: JSON.stringify(err),
					buttons: ['Dismiss']
				});
				alert2.present();
      });
    }
  }

First of all, it always triggers the catch on the iPhone but never when on the PC.

Secondly, when I try to debug on the iPhone, neither JSON.stringify(err) nor err.text works as a method of accessing what is throwing the error. Can anyone provide some insight into this?

Thanks,
Ray

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70918

Trending Articles



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