https://github.com/pocesar/angular-cleanmask
Angular helper directive to use the $viewValue of a ui-mask
https://github.com/pocesar/angular-cleanmask
Last synced: about 1 year ago
JSON representation
Angular helper directive to use the $viewValue of a ui-mask
- Host: GitHub
- URL: https://github.com/pocesar/angular-cleanmask
- Owner: pocesar
- Created: 2014-04-08T02:54:37.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-09-20T09:14:28.000Z (almost 12 years ago)
- Last Synced: 2024-10-18T06:28:33.378Z (over 1 year ago)
- Size: 168 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
AngularJS clean mask directive
=================
Angular helper directive to use the $viewValue of a ui-mask
## Why?
When you use `ui-mask` directive, you end up with a model with only numbers (for example).
You lose the format and everything, which is why you use `ui-mask` in the first place.
```html
```
You end up with:
```js
$scope.doh === '1234561234'
```
Not pretty.
## Usage
```js
angular.module('yourapp', ['ngCleanMask']);
```
```html
```
```js
$scope.yup === '(12) 3456-1234' // model is correct now!
```