title: BrainTree.js with AngularJS and customVariables
body: <p>I am using the BrainTree.js for PCI compliance, and the tutorial I am using here:</p>
  
  <p><a href="https://www.braintreepayments.com/docs/javascript" rel="nofollow">https://www.braintreepayments.com/docs/javascript</a></p>
  
  <p>There recommendation is to call the form by the ID like so:</p>
  
  <pre><code>var braintree = Braintree.create("YourClientSideEncryptionKey");
  braintree.onSubmitEncryptForm('braintree-payment-form');
  </code></pre>
  
  <p>I'm using AngularJS with the form being inside a controller. So inputs such as name, card, etc are tied to a scope using ng-model:</p>
  
  <pre><code>&lt;div class="form-group"&gt;
    &lt;label&gt;Card Number&lt;/label&gt;
    &lt;input type="text" class="form-control" name="number" ng-model="card.number" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My question is how can I submit a form using AngularJS and BrainTree.js in a manner that uses the data collected using ng-model? </p>
  
  <p><strong>Example:</strong></p>
  
  <pre><code>braintree.onSubmitEncryptForm({name: $scope.card.name, card: $scope.card.number});
  </code></pre>