title: Delay form submit (AngularJS)
body: <p>How can I prevent submitting a form in Angular until I receive a callback?</p>
  
  <p>I have something along these lines:</p>
  
  <pre><code>&lt;form method="post" action="http://example.com/external" ng-submit="submit()"&gt;
    &lt;input type="hidden" name="foo" value="{{bar}}" /&gt;
    &lt;input type="submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Before submitting the form, I need to get the <code>{{bar}}</code> value from a local API call (using <code>$http</code>), and place it in the scope before allowing the <strong>actual</strong> form to submit (not POSTed using <code>$http</code>). How can this be done?</p>