I want to execute this code to reset my app when it goes to the app homepage. It works but obviously loops round as it reloads and reloads. What javascript do I need to add to get it to execute only once when it enters the page?
.controller('HomeCtrl', function ($scope, $window) {
$scope.$on('$ionicView.beforeEnter', function() {
**$window.location.reload(true);**
})
})