ion-back-button not showing without defaultHref

Issue

I’m using angular’s own routing this.router.navigate(['/locaties']);. When I navigate forward it still doesn’t show up. What am I doing wrong?

toolbar.component.html

<ion-toolbar color="primary">
  <ion-buttons slot="start">
    <ion-back-button slot="start"></ion-back-button>
  </ion-buttons>

  <ion-title> {{ _toolbarTitle | async }} </ion-title>

  <img slot="end" src="assets/specto_logo.svg" />
</ion-toolbar>

Solution

It is because there is nothing on the ionic history stack. In order to have it show you must use the ionic controller.

this.navCtrl.navigateForward('/locaties');

https://ionicframework.com/docs/v3/api/navigation/NavController/

https://ionicthemes.com/tutorials/about/ionic-navigation-and-routing-ultimate-guide

Answered By – E. Maggini

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published