title: Trying to use $scope.$apply(), but it throws an error "$scope.$apply is not a function"
body: <p>Trying to call the <code>$scope.$apply</code>, but throws an error saying:</p>
  
  <blockquote>
    <p>$scope.$apply is not a function</p>
  </blockquote>
  
  <p>Following is the code :</p>
  
  <pre><code>function loadUnitChanged(event, data) {
          console.log('Event Info: ', event);
              setTimeout(function () {
                  $scope.$apply(function () {
                      $scope.cargoregisters = createArrayFromLoadUnit(data);
                  });
              }, 2000);           
      }
  </code></pre>
  
  <p>=========================================================</p>
  
  <pre><code> angular.module('portwin.cargo').controller('CargoController', function     ($rootScope, $location, $timeout, $mdDialog, cargoGateway) {
      var $scope = this;
  
      // Event handlers
      $rootScope.$on('cargodetails:loaded', cargoDetailBaseDataLoaded);
     $rootScope.$on('cargoRegistration:loaded',      cargoRegistrationBaseDataLoaded);
      $rootScope.$on('loadUnit:changed', loadUnitChanged);
      $rootScope.$on('loadUnit:Saved', updateLoadUnitAfterSave);
  </code></pre>