I\'m trying to use Publish
and Subscribe
from ionic-angular
But I am not receiving any data nor error. Here are my codes
Page 1
Having read the posts here and other forums, seems like the part about subscribing to an event is rather tricky. I gather that understanding lifecycle hooks and how promises work is important to getting around the problem. The following works if you want a second page to be able to subscribe to a published event on an existing page:
this.navCtrl.setRoot(NextComponentPage, Parameters).then(()=>
{
this.events.publish("user:created", userdetails);
});