Closed AndrewLosikhin closed 7 years ago
So this just comes down to the fact that ccExp
watches the model values: https://github.com/bendrucker/angular-credit-cards/blob/master/src/expiration.js#L45-L50. Angular won't set those until it sees a valid result. I don't want to change it to watching view values since that'd require duplicate parsing and wouldn't respect any custom parsers you appended.
This should, however, be doable by also watching month.$valid && year.$valid
and returning false early from ccExp
when that's false.
Can't get to this right away but if you want to submit a PR I'd be happy to review.
Closing based on inactivity, I'm happy to review a PR if anyone is interested in landing this functionality
Steps to reproduce:
AR: ccForm.$error.ccExp is false
ER ccForm.$error.ccExp must be true because both of params are invalid.