# angular1-text-mask

> Angular 1 directive for input text masking

Latest version **6.1.2** (published 2018-05-07) · Unlicense license · 0 weekly downloads

## Install

```sh
npm install angular1-text-mask
pnpm add angular1-text-mask
yarn add angular1-text-mask
bun add angular1-text-mask
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 6.1.2 |
| Published | 2018-05-07 |
| First published | 2016-11-13 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 114.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8203 |
| Author | Thomas |
| Maintainers | lozjackson, msafi |

## Links

- npm: https://www.npmjs.com/package/angular1-text-mask
- Repository: https://github.com/text-mask/text-mask
- Homepage: https://github.com/text-mask/text-mask#readme
- Issues: https://github.com/text-mask/text-mask/issues
- npm.io page: https://npm.io/package/angular1-text-mask

## Recent versions

- 6.1.2 (latest) — 2018-05-07
- 6.1.1 — 2018-04-29
- 6.1.0 — 2018-04-29
- 6.0.3 — 2018-04-27
- 6.0.2 — 2018-04-20
- 6.0.1 — 2017-04-18
- 6.0.0 — 2017-03-31
- 5.0.0 — 2017-03-22
- 4.3.3 — 2017-03-20
- 4.3.2 — 2017-03-12
- 4.3.1 — 2017-03-11
- 4.3.0 — 2017-03-09
- 4.2.0 — 2017-02-28
- 4.1.0 — 2017-02-27
- 4.0.0 — 2017-02-25
- … 4 more at https://npm.io/package/angular1-text-mask/versions

## README

# Angular Input Mask

## Getting started

First, install it.

```bash
npm i angular1-text-mask --save
```

Then, use it as follows:

```html
<script
  type="text/javascript"
  src="./node_modules/angular1-text-mask/dist/angular1TextMask.js"></script>
<script type="text/javascript">
  // First add Text Mask as a module
  angular
    .module('app', ['text-mask'])

    // Then use it in your Angular1 component as such
    .component('app', {
      controller: 'DemoController as $ctrl',
      template: '<input text-mask="$ctrl.textMaskConfig" ng-model="$ctrl.myModel" type="text"/>'
    })
    .controller(function() {
      var vm = this
  
      this.myModel = ''
      this.modelWithValue = '5554441234'
  
      this.textMaskConfig = {
        mask: ['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/]
      }
    })
</script>
```

## Documentation

As you can see in the code above, you are passing an object to the `text-mask` directive.

For more information about the values that the `text-mask` object accepts, see 
**[this page](https://github.com/text-mask/text-mask/blob/master/componentDocumentation.md#readme)**.

## Example

To see an example of a minimal app running with this directive, follow these steps:

1. Clone the repo, `git clone git@github.com:text-mask/text-mask.git`
1. `cd text-mask`
1. `npm install`
1. `npm run angular1:dev`
1. Open [http://localhost:3000](http://localhost:3000)

The code of the example is in [`angular1/example`](https://github.com/text-mask/text-mask/tree/master/angular1/example).

---
_Source: https://npm.io/package/angular1-text-mask · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
