Angular2, inputmask ngModel binding
See original GitHub issueHello everyone, I have some problem with ng2 ang inputmask. For example I have had this code
component.html
<div class="form-group col-sm-7"> <label class="control-label" for="sender-phone">Phone *</label> <input type="text" [(ngModel)]="sender.phone" class="form-control" id="sender-phone" placeholder="Phone"> </div>
component.ts
ngAfterViewInit() { let phoneNumberInput = document.getElementById('sender-phone'); let inputmask = new Inputmask('+7(999)999-99-99'); inputmask.mask(element); }
Inputmask is working good. But my [(ngModel)] didn’t work. Anyone know how I can resolve my issue ?
My code for example http://plnkr.co/edit/F3pob7hH2ZrJv0MDNa9x?p=preview
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Angular2, inputmask ngModel binding - Stack Overflow
I have resolve problem of this issue. http://plnkr.co/edit/tN6y5d2fsl0b7cRq6Prv?p=preview. You need create directive with InputMask
Read more >Angular2, inputmask ngModel binding - Google Groups
The problem is that your JQ plugin is not fireing the needed events. It eats the change and input events. It does not...
Read more >jQuery inputmask plugin + AngularJS - valve's
I was working on a small angularjs application and needed a text input masking to force users to enter their telephone numbers in...
Read more >How to Use Input Masks to Validate Input in an Angular App
Input validation is always a chore to set up. An input mask is a way to enforce the format of the user's input...
Read more >InputMask Control | Input | Angular Wijmo Demos - GrapeCity
The InputMask control allows you to validate and format user input as it is entered, preventing users from entering invalid data.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
And this is a similar directive for restrict input:
Usage like so:
I use inputmask through primeng(http://www.primefaces.org/primeng/#/mask). I decided to use it later until it is fixed. thx~