Json Ionic 3 - take and display a specific data from a json file with click button


#1

Hi Everyone

I would like to open a new page and display a specific data if the users click on a button. For example, imagine this button => [Click here for more details of Tome Cruise]

If the users click on it, i want for example a new page with the title+content of the Tome Cruise from the Json link.

How i should begin coding ?

Thanks !


#2

Hi@fdggfhgffsdfsf
If you want to show particular data from json.Pass the data you want to show as parameter to details page through the click function.

HTML
	<button ion-button full (click)="Details(TomeCruise.address)">
		View Details
	</button>
TS

Details(address){
 this.navCtrl.push(detailspage,{data:address});
}
You can get the data on detailspage with navparams.
this.navParams.get('data');
console.log(data);

Please let me know if you have any doubt