title: $apply vs $digest in directive testing
body: <p>If I have a directive that responds to the status of a particular attribute on the scope, and I want to change that attribute in my test and verify that it responds correctly, which is the best way of doing that change?</p>
  
  <p>I've seen both these patterns:</p>
  
  <pre><code>scope.$apply(function() {
      scope.myAttribute = true;
  });
  </code></pre>
  
  <p>and </p>
  
  <pre><code>scope.myAttribute = true;
  scope.$digest();
  </code></pre>
  
  <p>What is the difference between them, and which is better and why?</p>