detail.ts
...
import { NavController, NavParams } from 'ionic-angular'; // <-- NavParams needed to pass data between pages
...
...
@Component({
selector: 'page-detail',
templateUrl: 'detail.html',
})
export class DetailPage {
// Get data passed from HomePage
key: string = this.navParams.get('$key');
title: string = this.navParams.get('title');
body: string = this.navParams.get('body');
timestamp: string = this.navParams.get('timestamp');
authorId: string = this.navParams.get('authorId');
authorName: string = this.navParams.get('authorName');
authorEmail: string = this.navParams.get('authorEmail');
authorPhoto: string = this.navParams.get('authorPhoto');
constructor(public navCtrl: NavController, public navParams: NavParams) {
// Listen for new data on this subject
...
...
}
}