Very newbie quesiton maybe, but I red that we can’t push string ?
console.log is showing the string, but nav push is crashing
Here’s my code :
import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import { Suites } from '../page3/suites/suites';
@Component({
selector: 'page-page3',
templateUrl: 'page3.html'
})
export class Page3 {
selectedItem: any;
items: Array<{title: string, url:string}>;
constructor(public navCtrl: NavController, public navParams: NavParams) {
// If we navigated to this page, we will have an item available as a nav param
this.selectedItem = navParams.get('item');
this.items = [];
this.items.push({title: 'Suites (4)', url:'Suites'});
this.items.push({title: 'Intégration (2)',url:'integration'});
this.items.push({title: 'Fonctions trigonométriques (4)',url:'fctrigo'});
this.items.push({title: 'Exponentielle (2)',url:'expo'});
this.items.push({title: 'Logarithme népérien (2)',url:'loga'});
this.items.push({title: 'Étude de fonctions (2)',url:'etudefonction'});
}
itemTapped(event, item) {
console.log(item.url);
this.navCtrl.push( item.url, {
item: item
});
}
}