Directive to masquerade input in angular 2/4 (money and number).
(087) 8745-9876 - 76888-098 - R$ 1.234,00 - $ 1.00
To install this library, run:
$ npm install soft-angular-mask --saveand then from your Angular AppModule:
...
// Import library
import { MaskModule } from 'soft-angular-mask';
@NgModule({
...
imports: [
MaskModule
],
...
})
export class AppModule { }Use in your Angular application:
<!-- in html -->
<input mask-number [mask]="'99999-999'" name="valCode" [(ngModel)]="valCode">
<input mask-number [mask]="'(99) 999999999'" [reqMin]="13" name="valPhone" [(ngModel)]="valPhone">
<input mask-money [prefix]="'R$'" name="valMoney" [(ngModel)]="valMoney">
[mask]="'9'" <!-- '9' - represents a number -->
[reqMin]="1" <!-- minimum size to mask -->
[maskkOutput]="true" <!-- output ngModel masked -->[prefix]="'R$'" <!-- printed before value -->SouUmLucas (10/11/2017) - enable output of ngModel masked / status: implemented
MIT © Renato Souza de Oliveira email: mailto:[email protected]