I am using angular-credit-cards to create a credit card form. The credit card number has the following setup:
<!--... form stuff ...-->
<div class="form-group" ng-class="{'has-success': donationForm.ccNumber.$valid}">
<label for="ccNumber">Credit Card Number</label>
<div class="input-group">
<input type="text" class="form-control" name="ccNumber" ng-model="credit_card.number" cc-number cc-eager-type/>
<div class="input-group-addon">{{donationForm.ccNumber.$ccEagerType}}</div>
</div>
</div>
<!--... more form stuff ...-->
When this form is submitted, it calls a function that creates a Paypal payment. Paypal payments need a credit card type. angular-credit-cards determines the credit card type dynamically based on the input that the cc-number directive is a part of and stores it in the input's $ccEagerType. However, how do I get this data from the input and hand it to the controller?
I tried the following:
<input type="hidden" ng-model="credit_card.type" ng-value="donationForm.ccNumber.$ccEagerType"/>
But donationForm.ccNumber.$ccEagerType is not being binded to credit_card.type.
Thanks in advance.