Binding data from view to controller in AngularJS
<p>Hello I am building an angular application and I have a problem inside my stripe form. Basically I send data such as card number, expiry date and CVC code from the view to the controller's stripe callback, but I would like to add also the amount of money to pay. So I added this into my form:</p>

<pre><code>&lt;form stripe-form="handleStripe" name="myForm"&gt;
    &lt;!-- input added for the price --&gt;
    &lt;div class="row" ng-if="!unregistered_user"&gt;
        &lt;div class="input-field col col-xs-12"&gt;
            &lt;label for="name"&gt;Amount &lt;/label&gt;
            &lt;input name='price' type="number" id="amount" ng-model="price"&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;!-- credit/debit card form --&gt;
    &lt;div class="row"&gt;
        &lt;div class="input-field col col-xs-12"&gt;
            &lt;label for="cardn"&gt;Card number&lt;/label&gt;
            &lt;input type="text" name="number" id="cardn"  ng-model="number" payments-validate="card" payments-format="card" payments-type-model="type" ng-class="myForm.number.$card.type"/&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="row"&gt;
        &lt;div class="input-field col-xs-6"&gt;
            &lt;label for="exp"&gt;Expiry&lt;/label&gt;
            &lt;input type="text" id="exp" ng-model="expiry" payments-validate="expiry" payments-format="expiry" /&gt;
        &lt;/div&gt;
        &lt;div class="input-field col-xs-6"&gt;
            &lt;label for="cvc"&gt;CVC&lt;/label&gt;
            &lt;input type="text" id="cvc" ng-model="cvc" payments-validate="cvc" payments-format="cvc" payments-type-model="type"/&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="row"&gt;
        &lt;div class="input-field col-xs-12"&gt;
            &lt;button type="submit" class="btn btn-primary btn-large"&gt;Pay {{ price }}&lt;/button&gt;
        &lt;/div&gt;
   &lt;/div&gt;
&lt;/form&gt;
</code></pre>

<p>In the controller I have this variable:</p>

<pre><code>▸   $scope.price = 0;
</code></pre>

<p>When I first load the page I can see that the price input has exactly the same amount that I put in the variable $scope.price. But when I changed it in the page and submit the form, $scope.price is always 0.
It's like the data is being passed from the controller to the view, but not the way back from the view to the controller.</p>

<p>How can I solve this?</p>