1

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>
2
  • Is it visible if you put defaultHref? Apr 30, 2021 at 12:03
  • @iamentafaz yes it is but it always directs me to the defaulthref then Apr 30, 2021 at 12:27

1 Answer 1

2

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

1
  • Isn't navCtrl deprecated in favour of router.navigate?
    – Obi
    Aug 19, 2022 at 17:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.