I have a page that shows cities: this page use a provider called "CitiesProvider" Since these cities can change, i put u Subscription like:
this.citiesSubscription = this.CitiesProvider.salesChanged
.subscribe(
(cities: City[]) => this.cities = cities
)
Where is the perfect place to put the "unsubscribe" method between:
ionViewWillLeave
or ionViewDidLeave
or ionViewWillUnload
and what will go wrong if i put it in another?
And what's the difference between using these (Ionic) lifecycle hocks or using
ngOndestroy
from Anglar or any hocks coming from angular (since the ionic pages are also angular component