I understand Ionic events will be deprecated in next version. Currently I use events to executes functions in my parent page from sub components. Here is an example:
In my main page it subscribes to the event to refresh:
constructor(){
this.eventFormRefresh = (obj) => {
this.fetch(obj.isReset);
};
this.events.subscribe('form:refresh', this.eventFormRefresh);
}
ngOnDestroy(): void {
this.events.unsubscribe('form:refresh', this.eventFormRefresh);
}
In a subcomponent I activate the refresh by publishing the 'form:refresh' event as so:
this.events.publish('form:refresh');
How would I do the above using angular observables?