import { Component } from '@angular/core' ; import { NavController , NavParams } from 'ionic-angular' ; @ Component ( { selector : 'page-page2' , templateUrl : 'page2.html' } ) export class Page2 { selectedItem : any ; icons : string [ ] ; items : Array < { title : string ; note : string ; icon : string ; } > ; constructor ( public navCtrl , public navParams ) { this . selectedItem = navParams . get ( 'item' ) ; this . icons = [ 'flask' , 'wifi' , 'beer' , 'football' , 'basketball' , 'paper-plane' , 'american-football' , 'boat' , 'bluetooth' , 'build' ] ; this . items = [ ] ; for ( let i = 1 ; i < 11 ; i ++ ) { this . items . push ( { title : 'Item ' + i , note : 'This is item #' + i , icon : this . icons [ Math . floor ( Math . random ( ) * this . icons . length ) ] } ) ; } } itemTapped ( event , item ) { this . navCtrl . push ( Page2 , { item : item } ) ; } }