I'm facing a challenge in accessing NavParams within a provider, and simply importing NavParams is not solving the issue.
Here's a brief overview of my application: users input their name and address, a pin is dropped on the map based on the address provided. When the user clicks on the pin, an alert displaying the name associated with the pin pops up.
This is the section from my create-event.ts where I push the event name:
toMap() {
this.navCtrl.push('MapPage', {eName: this.eventDetail.eventName});
}
The data is then retrieved in Map.ts and pushed to markers.ts:
public eName: string;
constructor (...) {
this.eName = this.navParams.get('eName');
}
addMarker() {
// Function code here
}
geoCodeandAdd(address) {
// Function code here
}
loadMarkers() {
// Function code here
}
Next, let's take a look at the marker provider .ts file:
// Marker Provider code here
Following that, there is a stack trace error detailing issues related to NavController:
Error message here
In conclusion, I am exploring ways to effectively utilize navparams within the provider for smoother functionality.