When to do $ionicDeploy.check()

I currently do this:

    .controller('AppCtrl', function ($scope, $ionicModal, $timeout, $http, localStorageService, Benefits, $state, $rootScope, $ionicDeploy) {

  // With the new view caching in Ionic, Controllers are only called
  // when they are recreated or on app start, instead of every page change.
  // To listen for when this page is active (for example, to refresh data),
  // listen for the $ionicView.enter event:
  //$scope.$on('$ionicView.enter', function(e) {

    $ionicDeploy.channel = 'dev';
    $ionicDeploy.check().then(function (snapshotAvailable) {
        // When snapshotAvailable is true, you can apply the snapshot
        if (snapshotAvailable) {
            $ionicDeploy.download().then(function () {
                return $ionicDeploy.extract().then(function () {
1 Like

The answer was in the code submitted:

$scope.$on(’$ionicView.enter’, function(e) {