Skip to content
Emerson Brito edited this page Mar 15, 2019 · 5 revisions

Using InputMask

Start by importing the InputMaskModule:

import { InputMaskModule } from '@emerbrito/input-mask';

Then apply the directive to an input element and set the mask property:

<input inputMask mask="999-99-9999">

Properties

Name Description
mask: string The mask to be used. If not specified the directive is disabled.
value: string Optional. Value passed to the directive.
validateMask: boolean Optional. Defaults to true. Whether or not mask validation should propagate to FormControl - usefull when using Angular forms.
rules: RuleBase[] Custom rules registered with the directive. See section Custom Rules form more details.

Events

Properties

Name Description
format: EventEmitter<MaskEvent> Emits when the value value changes. Contains the formatted and unformatted values.
Clone this wiki locally