AngularJS / Ionic refresh when view loads

By default a controller only fires it’s init code when a view is first loaded. If you are using Tabs and move away, then come back, the controller will not fire again. To get it to fire again when the page reloads, refer to these:

http://stackoverflow.com/questions/27058276/run-a-controller-function-whenever-a-view-is-opened-shown
shows:

$rootScope.$on('$stateChangeSuccess', 
function(event, toState, toParams, fromState, fromParams){ ... })

and maybe this method:

.controller('MyCtrl', function($scope) {
  $scope.$on('$ionicView.enter', function() {
     // Code you want executed every time view is opened
     console.log('Opened!')
  })
})

There is also mention of how to turn this off for the entire app, but I won’t copy that here as I don’t want to do that.