ng-cpf-cnpj

WebJar for ng-cpf-cnpj

License

License

MIT
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

ng-cpf-cnpj
Last Version

Last Version

0.0.5
Release Date

Release Date

Type

Type

jar
Description

Description

ng-cpf-cnpj
WebJar for ng-cpf-cnpj
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/gil/ng-cpf-cnpj

Download ng-cpf-cnpj

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/ng-cpf-cnpj/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>ng-cpf-cnpj</artifactId>
    <version>0.0.5</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/ng-cpf-cnpj/
implementation 'org.webjars.bower:ng-cpf-cnpj:0.0.5'
// https://jarcasting.com/artifacts/org.webjars.bower/ng-cpf-cnpj/
implementation ("org.webjars.bower:ng-cpf-cnpj:0.0.5")
'org.webjars.bower:ng-cpf-cnpj:jar:0.0.5'
<dependency org="org.webjars.bower" name="ng-cpf-cnpj" rev="0.0.5">
  <artifact name="ng-cpf-cnpj" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='ng-cpf-cnpj', version='0.0.5')
)
libraryDependencies += "org.webjars.bower" % "ng-cpf-cnpj" % "0.0.5"
[org.webjars.bower/ng-cpf-cnpj "0.0.5"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.bower : cpf_cnpj jar [0.0.3,0.1)

Project Modules

There are no modules declared in this project.

ng-cpf-cnpj

AngularJS directive to validate CPF/CNPJ numbers, using cpf_cnpj.js.

How to install

bower install ng-cpf-cnpj --save

And add to your index.html

<script src="bower_components/cpf_cnpj/build/cpf.js"></script>
<script src="bower_components/cpf_cnpj/build/cnpj.js"></script>
<script src="bower_components/ng-cpf-cnpj/lib/ngCpfCnpj.js"></script>

And inject it to your angular.module

angular.module('myApp', ['ngCpfCnpj']);

How to use

Just add ng-cpf or ng-cnpj to any <input/>. You can also use ui-mask, from ui-utils, to restrict the format:

<form name="myForm">

  <input name="cpf" ng-model="cpf" ng-cpf ui-mask="999.999.999-99" />
  myForm.cpf.$valid: {{ myForm.cpf.$valid }}

  <input name="cnpj" ng-model="cnpj" ng-cnpj ui-mask="99.999.999/9999-99" />
  myForm.cnpj.$valid: {{ myForm.cnpj.$valid }}

</form>

Versions

Version
0.0.5