Note
Originally forkde from (Angular CC Library)['https://github.com/nogorilla/angular-cc-library']
Description
Angular CC Library - for validation and formating of input parameters
Demo
- Clone repo
- run
npm install
- run
npm run dev
- visit
http://localhost:4200
Usage
Installation
npm install angular-cc-library --save
Formating Directive
On the input fields, add the specific directive to format inputs.
All fields must be type='tel'
in order to support spacing and additional characters
;;;; ; @
Credit Card Formater
- add
ccNumber
directive:
- this will also apply a class name based off the card
.visa
,.amex
, etc. See the array of card types incredit-card.ts
for all available types
Expiration Date Formater Will support format of MM/YY or MM/YYYY
- add
ccExp
directive:
CVC Formater
- add
ccCvc
directive:
Validation
Current only Model Validation is supported. To implement, import the validator library and apply the specific validator on each form control
; @ implements OnInit form: FormGroup; submitted: boolean = false; {} { thisform = this_fb; } { thissubmitted = true; console; }
Inspiration
Based on Stripe's jquery.payment plugin but adapted for use by Angular2
License
MIT