Hi,
I’ve been trying to convert an Ionic3 project to Ionic4. I’ve been having a bit of trouble since the navParams don’t work the same way as they used to. This is the piece of code I want to change from Ionic3 to Ionic4.
let localData = http.get(‘assets/mylist.json’).map(res => res.json().items);
localData.subscribe(data => {
this.information = data;
for (var i = 0; i < this.information.length; i++) {
this.information[i].open = false;
}
this.toggleSection(navParams.data);
})
It loops through the Json and parses the information to an accordeon list.
I’ve tried this, but with no luck:
localData.subscribe(data => {
this.information = data;
for (var i = 0; i < this.information.length; i++) {
this.information[i].open = false;
}
this.toggleSection(this.activatedRoute.snapshot.paramMap.get(data));
})
How would I parse my JSON to my accordeon list in Ionic4?