angular - How to pass data in ionic2 -
i data through http. want pass data placeslistpage. there "id, name, category, ..." in data. want use theese in placeslistpage this: {{xxx.id}}, {{xxx.name}}... please me... xxx - example)
import {page, navcontroller, navparams} 'ionic-angular'; import {http} 'angular2/http'; import 'rxjs/rx'; import {placeslistpage} '../places-list/places-list'; /*enter code here generated class placespage page. see http://ionicframework.com/docs/v2/components/#navigation more info on ionic pages , navigation. */ @page({ templateurl: 'build/pages/places/places.html', }) export class placespage { static parameters() { return [[navcontroller], [http], [navparams]]; } constructor(nav, http, navparams) { this.nav = nav; this.http = http.get('https://api.myjson.com/bins/2ud24').map(res => res.json()).subscribe( (data) => { this.data = data; }); }
you can use approach well:
let = { test: 1 }; this.nav.push(existingpaymentmodal, {something});
and than
constructor(private navparams: navparams) { this.something = this.navparams.get("something"); }
Comments
Post a Comment