Search code examples
javascriptangularjs-directivekeypad

I need a customized Numeric keypad for mobile


I'm developing a Hybrid App and I want my app to open a customized Numeric keypad that looks the same on all devices. Is there any AngularJS directive?


Solution

  • I ran into the same problem before as I needed a consistent Numeric Keypad that looks the same on all devices and I ended up creating one. You can find it on github:

    Code

    Demo

    It's a module composed of

    • Numeric Keyboard Directive which should be only one copy in the whole app, it's template is the actual keyboard
    • Numeric Keyboard Input Directive, It's a clickable directive that opens your keyboard, you need to attach it to the editable element where you want your input to be.
    • Numeric Keyboard Service, which handles the communication between the two directives.

    angular.module('numericKeyboard').factory('numericKeyboardService',numericKeyboardService);

    angular.module('numericKeyboard').directive('numericKeyboard', numericKeyboard);

    angular.module('numericKeyboard').directive('numericKeyboardInput', numericKeyboardInput);