You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 24, 2020. It is now read-only.
It's really basic at the moment, lots of cases are not being handled. Might be worth to port-in a complete jQuery solution instead. I'm working on a business project and took a more complex approach to formatting the card number. What I do is upon any change, I flash the reformatted card number, and then I position the caret back to its expected position. It's a lot of work, but the finished result is much smoother.
You may also want to refrain from using event.preventDefault(), as this stops the scope on the field from $digesting. So if another directive is watching a change to the value, it won't be propagated as expected..
The text was updated successfully, but these errors were encountered:
Big +1 to rethinking the $digest blocking. A bound model should always contain the content. IMO a plugin should never overwrite a piece of core framework functionality unless that plugin is specifically designed to do just that. We shouldn't need a work-around just to know if an input has content.
Give angular-credit-cards 2.3 a shot. I've added formatting that does a reasonably good job of getting the cursor position right without breaking out of Angular's native input handling events.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It's really basic at the moment, lots of cases are not being handled. Might be worth to port-in a complete jQuery solution instead. I'm working on a business project and took a more complex approach to formatting the card number. What I do is upon any change, I flash the reformatted card number, and then I position the caret back to its expected position. It's a lot of work, but the finished result is much smoother.
You may also want to refrain from using event.preventDefault(), as this stops the scope on the field from $digesting. So if another directive is watching a change to the value, it won't be propagated as expected..
The text was updated successfully, but these errors were encountered: