# Mask

### What?

Apply a mask on an input field so the user can only type pre-determined pattern.

Masked Input:
Model value: `{{x}}`
Model value: `undefined`
NgModelController.$viewValue: `{{demo.masked.$viewValue}}`
NgModelController.$viewValue: `undefined`
Mask Definition:
`A` Any letter.
`9` Any number.
`*` Any letter or number.
`?` Make any part of the mask optional.
Predefined masks:

### How?

    <input type="text" ng-model="phonenumber" ui-mask="(999) 999-9999"/>

Replace "(999) 999-9999" with your desired mask.