Is it possible to have model-driven form in Angular 2 and implement a directive that would allow to mask an input
field like a phone number entry (123) 123-4567
?
相关问题
- Angular RxJS mergeMap types
- Laravel Option Select - Default Issue
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- HTML form is not sending $_POST values
- How to use Control.FromHandle?
相关文章
- angular脚手架在ie9+下兼容问题
- angular 前端项目 build 报错 "Cannot find module 'le
- 放在input的text下文本一直出现一个/(即使还没输入任何值)是什么情况
- Angular Material Stepper causes mat-formfield to v
- After upgrade to Angular 9 cannot find variable in
- is there any difference between import { Observabl
- Suppress “Circular dependency detected” suppress w
- How can you get current positional information abo
I do this using the TextMaskModule from 'angular2-text-mask'
Mine are split but you can get the idea
Package using NPM NodeJS
HTML
Inside Component
No need to reinvent the wheel! Use Currency Mask, unlike TextMaskModule, this one works with number input type and it's super easy to configure. I found when I made my own directive, I had to keep converting between number and string to do calculations. Save yourself the time. Here's the link:
https://github.com/cesarrew/ng2-currency-mask