title: Differences between $scope.apply(); and $scope.apply(function(){});
body: <p>Take this code:</p>
  
  <pre><code>$scope.$apply(function(){
      $scope.foo = 'test';
  });
  </code></pre>
  
  <p>Versus this one:</p>
  
  <pre><code>$scope.foo = 'test';
  $scope.$apply();
  </code></pre>
  
  <p>What is the difference between those two? I tried searching but could not find any information about this.</p>
  
  <p>Or even this approach:</p>
  
  <pre><code>$scope.$apply('foo = "test"');
  </code></pre>