I have many pages in my app, I have one common value for entire app {{itemcount}} I am using localstorage to save this value, so whenever I want to update this value I update local storage value and it’s get update, I have create on function on my homepage and calling from constructor:
this.listenToMyVal()
listenToMyVal() {
this.events.subscribe('myval:itemcount', () => {
this.storage.get('itemcount').then((value) => {
this.itemcount = value;
});
});
}
It’s working on my homepage, is there any common way so my itemcount value will update from any page.