Giter VIP home page Giter VIP logo

Comments (4)

bendrucker avatar bendrucker commented on June 14, 2024

The problem here stems from the fact that your model is invalid until a full number is entered. What's weird is that the first 4 digits are being recorded to the model (4444) but then the next 4 results in the model being '' (empty string). The latter is the expected behavior that should be happening the whole time.

You're going to need to use ngModelOptions and its allowInvalid method to implement this. The weird behavior is a bug, but the fix will be ensuring that the model is always undefined, even w/ cc-format. That won't help you.

from angular-credit-cards.

ajbraus avatar ajbraus commented on June 14, 2024

+1 - Mine ends before I can enter the last number: 4242 4242 4242 4242 424

input.form-control(type='text', ng-model="card.number", cc-format, cc-number, placeholder="4242 4242 4242 4242 4242" required)

from angular-credit-cards.

bendrucker avatar bendrucker commented on June 14, 2024

You've got 19 digits typed out -- that's the maximum. Don't think that's a bug.

from angular-credit-cards.

bendrucker avatar bendrucker commented on June 14, 2024

Just implemented a fix. If you want users to be able to type on the keyboard and use your UI keypad you'll need to use the allowInvalid model option.

from angular-credit-cards.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.