Where should I free up resources? $destroy or $ionicView.unloaded?


#1

I’m little bit confused where I should free up resources. Should I do in $scope.$on(’$destroy’, …) or $scope.$on(’$ionicView.unloaded’, …)?


#2

in generel you do not need to care about.
if you want to remove unnecessary events and so on i would prefer the $destroy-event.

The ionicView-events or there to interact with special states of your views like if they are cached, but you want to be informed if the view gets opened again and so on.

If you view is not needed anymore or is not a backview ionic clears the cached stuff.