[](https://github.com/amarkes/br-mask/issues) [](https://github.com/amarkes/br-mask/stargazers) [




return custom mask in input for ionic 6/7
``sh`
npm install br-packs-mask --save -E
`javascript
import { BrMaskerModule } from 'br-packs-mask';
@NgModule({
imports: [
BrMaskerModule
],
})
`
`html
`
`html
`
`html`
`html`
`html`
`html`
`html`
`html`
`html`
`html`
js
import { BrMaskDirective, BrMaskModel } from 'br-mask';...
constructor(public brMask: BrMaskDirective) {}
...
protected createForm(): FormGroup {
return new FormGroup({
phone: new FormControl(this.createPhone())
});
}
private createPhone(): string {
const config: BrMaskModel = new BrMaskModel();
config.phone = true;
return this.brMask.writeCreateValue('99999999999', config);
}
`Inputs
* brmasker: BrMaskModel
`ts
BrMaskModel = {
form: AbstractControl;
mask: string;
len: number;
money: boolean;
phone: boolean;
phoneNotDDD: boolean;
person: boolean;
percent:boolean;
type: 'alfa' | 'num' | 'all';
decimal: number = 2;
decimalCaracter: string = ,;
thousand: string;
userCaracters = false;
numberAndTousand: false,
moneyInitHasInt: true
}
`
| Name | type | info |
| ------ | ------ | ------ |
| form | FormControl | Obsolete |
| mask | string | Optional |
| len | string | Optional |
| money | boolean | Optional |
| phone | boolean | Optional |
| phoneNotDDD | boolean | Optional |
| person | boolean | Optional |
| percent | boolean | Optional |
| type | string | Optional default 'all' |
| decimalCaracter | string | Optional default ',' |
| decimal | number | Optional default '2' |
| thousand | string | Optional |
| userCaracters | boolean | Optional default
false |
| numberAndTousand | boolean | Optional default false |
| moneyInitHasInt | boolean | Optional default true |
moneyInitHasInt is when you need to use cents in value Characters
- . / ( ) , * + @ # $ & % :`