bendrucker / angular-credit-cards

Angular directives for parsing and validating credit card inputs
MIT License
328 stars 98 forks source link

If month and year are defined as string, ccExpMonth and ccExpYear shows different result than ccExp #27

Closed hinok closed 9 years ago

hinok commented 9 years ago

If month and year are set as strings not numbers, validation is not in sync.

Like

myCard = {
    year: '2019',
    month: '10'
  };

ccExpMonth.$valid and ccExpYear.$valid are equal to false. ccExp.$valid is equal to true.

screen of plnkr

Plnkr http://plnkr.co/edit/oJluKcoqpdwqufYP0D1q?p=preview

bendrucker commented 9 years ago

Sorry for missing this one somehow. Those aren't valid values. Inject creditcards and use its parsers directly to cast the values properly.