You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can define your custom options for all directives (as object in the mask module) or for each (as attributes for directive). If you override this parameter, you have to provide all the special characters (default one are not included).
69
+
You can define your custom options for all directives (as object in the mask module) or for each (as attributes for directive). If you override this parameter, you have to provide all the special characters (default one are not included).
You can choose clear the input if the input value **not match** the mask, default value false
185
+
You can choose clear the input if the input value **not match** the mask, default value is `false`.
197
186
198
187
### Pipe with mask expression and custom Pattern ([string, pattern])
199
-
You can pass array of expression and custom Pattern to pipe
188
+
You can pass array of expression and custom Pattern to pipe.
200
189
201
190
##### Usage
202
-
203
191
```html
204
-
<span>{{phone|mask: customMaska}}</span>
192
+
<span>{{phone|mask: customMask}}</span>
205
193
```
194
+
206
195
and in your component
207
-
```
208
-
customMaska: [string, pattern];
196
+
```typescript
197
+
customMask: [string, pattern];
209
198
210
-
pattern= {
211
-
'P': {
212
-
pattern: newRegExp('\\d'),
213
-
}};
199
+
pattern= {
200
+
'P': {
201
+
pattern: newRegExp('\\d'),
202
+
}
203
+
};
214
204
215
-
this.customMaska= ['PPP-PPP', this.pattern];
205
+
this.customMask= ['PPP-PPP', this.pattern];
216
206
```
217
207
218
208
### Repeat mask
219
-
You can pass into mask pattern with brackets
209
+
You can pass into mask pattern with brackets.
220
210
221
211
##### Usage
222
-
223
212
```html
224
-
<inputtype='text'mask="A{4}">
213
+
<inputtype="text"mask="A{4}">
225
214
```
226
215
227
216
### Thousand separator
228
-
You can devide your input by thousands
217
+
You can divide your input by thousands.
229
218
230
219
##### Usage
231
-
232
220
```html
233
-
<inputtype='text'mask="separator">
221
+
<inputtype="text"mask="separator">
234
222
```
235
-
For separate input with dots
236
223
224
+
For separate input with dots
237
225
```html
238
-
<inputtype='text'mask="dot_separator">
226
+
<inputtype="text"mask="dot_separator">
239
227
```
240
-
For using decimals enter '.' to the end of your input to 'separator' mask and ',' to 'dot_separator'
241
228
229
+
For separate input with commas
242
230
```html
243
-
<inputtype='text'mask="comma_separator">
244
-
```
245
-
For using decimals enter '.' to the end of your input to 'separator' or 'comma_separator' mask and ',' to 'dot_separator'
246
-
247
-
248
-
```
249
-
Inputvalue: 1234.56
250
-
Maskedvalue: 1234.56
251
-
252
-
Inputvalue: 1234,56
253
-
Masked value: 1.234,56
254
-
255
-
Input value: 1234.56
256
-
Maskedvalue: 1,234.56
231
+
<inputtype="text"mask="comma_separator">
257
232
```
258
233
234
+
For using decimals enter `.` to the end of your input to 'separator' or 'dot_separator' mask and `,` to 'comma_separator'.
259
235
```html
260
-
<input type='text'mask="dot_separator.2">
261
-
<input type='text'mask="comma_separator.2">
262
-
<input type='text'mask="dot_separator.0">
263
-
<input type='text'mask="comma_separator.0">
236
+
<input type="text" mask="dot_separator.2">
237
+
<input type="text" mask="comma_separator.2">
238
+
<input type="text" mask="dot_separator.0">
239
+
<input type="text" mask="comma_separator.0">
264
240
```
265
-
For limiting decimal precision add '.' and the precision you want to limit too on the input. 2 is useful for currency. 0 will prevent decimals completely.
266
241
242
+
For limiting decimal precision add `.` and the precision you want to limit too on the input. **2** is useful for currency. **0** will prevent decimals completely.
267
243
```
268
244
Input value: 1234,56
269
245
Masked value: 1.234,56
@@ -277,55 +253,51 @@ Masked value: 1.234
277
253
Inputvalue: 1234.56
278
254
Maskedvalue: 1,234
279
255
```
256
+
257
+
For limiting the number of digits before the decimal point you can set `separatorLimit` value to _10_, _100_, _1000_, etc.
0 commit comments