README
tupini-validators
Brazilian CPF and CNPJ Validators for Angular Forms;
This library was generated with Nx.
Running unit tests
Run npx nx test tupini-validators
to execute the unit tests.
Build
Run npx nx build tupini-validators
to build the TupiniValidators lib. The built artifacts will be stored in the dist/
directory. Use the --prod
flag for a production build.
How to use
Import TupiniValidator into your component class:
import { TupiniValidators } from '@tupini-tech/tupini-validators';
Validating cpf field:
control = new FormControl(null, {validators: [TupiniValidators.cpf]})
Validating cnpj field:
control = new FormControl(null, {validators: [TupiniValidators.cnpj]})
Further help
Visit the Nx Documentation to learn more.