title: Error: [$rootScope:inprog] $digest already in progress
body: <p>I'm trying so send a form (using a directive) when a property in the model changes (so I watch the property), but when I trigger the submit event, I get the error: "Error: [$rootScope:inprog] $digest already in progress", how can I avoid this error, here is my code: </p>
  
  <pre><code>app.directive("autoSubmit", function(){
    return {
      link: function(scope, element, attrs){
  
        scope.$watch("valid", function(){ 
          if(scope.valid == 1) {
            console.log("send form");
            element.triggerHandler("submit");
          }
        });
      }
    }
  });
  </code></pre>
  
  <p>Heres is he plunk: <a href="http://plnkr.co/edit/cosJLkhUEKv55G8uU1Ea">http://plnkr.co/edit/cosJLkhUEKv55G8uU1Ea</a> (to reproduce the error, just change the value of the textbox to 1)</p>
  
  <p>Thanks in advance for your help.</p>