Property 'push' does not exist on type 'NavController'

import { Component } from ‘@angular/core’;
import { NavController } from ‘@ionic/angular’;
import { DetailsPage } from ‘…/details/details.page’;

@Component({
selector: ‘app-home’,
templateUrl: ‘home.page.html’,
styleUrls: [‘home.page.scss’],
})
export class HomePage {
Articles : any;
constructor(public navCtrl : NavController) {
this.Articles =[
{nom :‘Boubou Homme’, prix : 10000, details :‘details Boubou Homme’ },
{nom :‘Robe Femme’, prix : 8500, details :‘details Robe Femme’},
{nom :‘Robe simple’, prix : 5000, details :‘details Robe simple’},
{nom :‘Chemise Homme’, prix : 3500, details :‘details Chemise Homme’},
{nom :‘Chemise Femme’, prix : 3500, details :‘details Chemise Femme’},
{nom :‘Pantalon simple Homme’, prix : 3500, details :‘Pantalon simple Homme’},

]

}
DetailsPage() : void {
this.navCtrl.push(DetailsPage);
}

}

$ npm ls @ionic/angular

PS C:\ionicApp\Shopping> npm ls @ionic/angular
Shopping@0.0.1 C:\ionicApp\Shopping
`-- @ionic/angular@4.7.4

In that case, you’re writing against Ionic 4 and want to be using Angular’s router. A modern equivalent to push would be navigateForward if you really want to keep using NavController.

thanks you very much

Le mar. 13 août 2019 à 17:39, Robert Coie via Ionic Forum ionicframework@discoursemail.com a écrit :