https://github.com/flasd/ng-cpf-cnpj
AngularJS directive to validate CPF/CNPJ numbers.
https://github.com/flasd/ng-cpf-cnpj
Last synced: 10 months ago
JSON representation
AngularJS directive to validate CPF/CNPJ numbers.
- Host: GitHub
- URL: https://github.com/flasd/ng-cpf-cnpj
- Owner: flasd
- License: mit
- Created: 2018-02-01T02:28:58.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-02T17:57:40.000Z (over 8 years ago)
- Last Synced: 2025-08-06T04:40:26.915Z (10 months ago)
- Language: JavaScript
- Size: 85.9 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ng-cpf-cnpj
AngularJS directive to validate CPF/CNPJ numbers, using [cpf_cnpj.js](https://github.com/fnando/cpf_cnpj.js).
[](https://travis-ci.org/flasd/ng-cpf-cnpj)
[](https://www.npmjs.com/package/ng-cpf-cnpj)
### Instalation
```npm install ng-cpf-cnpj cpf_cnpj --save```
And add to your index.html
```html
```
And inject it to your angular.module
```angular.module('myApp', ['ngCpfCnpj']); ```
### Usage
Just add ```ng-cpf``` or ```ng-cnpj``` to any ``````.
```html
myForm.cpf.$valid: {{ myForm.cpf.$valid }}
myForm.cnpj.$valid: {{ myForm.cnpj.$valid }}
```
You can also use ```ui-mask```, from [ui-utils](https://github.com/angular-ui/ui-utils), to restrict the format:
```html
myForm.cpf.$valid: {{ myForm.cpf.$valid }}
myForm.cnpj.$valid: {{ myForm.cnpj.$valid }}
```
### Copyright and License
Copyright (c) 2017 [Marcel de Oliveira Coelho](https://github.com/flasd) under the [MIT license](https://github.com/flasd/ng-cpf-cnpj/blob/master/LICENSE). Go Crazy. :rocket: