<ion-nav>
supports push as per the document here -- https://ionicframework.com/docs/api/nav
My currentPage html (current-page.page.html) has a button component -
<ion-button (click)="goToNextPage()">Next Page</ion-button>
My currentPage script file (current-page.page.ts) has following code -
import { Component, OnInit } from '@angular/core';
import { NavController, NavParams } from '@ionic/angular';
import { NextPage } from '../next-page/next-page.page';
@Component({
selector: 'current-page',
templateUrl: './current-page.page.html',
styleUrls: ['./current-page.page.scss'],
})
export class CurrentPage implements OnInit {
constructor(public navCtrl: NavController, public navParams: NavParams) { }
goToNextPage () {
this.navCtrl.push('NextPage');
}
ngOnInit() {
}
}
However, I get the format error as Property 'push' does not exist on type 'NavController'
Not sure how to use the push method properly. Any help will be appreciated.