Closed arturhun closed 4 years ago
There is already a way to implement this, just use CreditCard
class from a library, but I will also put this into a projects roadmap because this seems not really hard to do and will not break anything.
public type$ = defer(() => this.demoForm.get('creditCard').valueChanges)
.pipe(map((num: string) => CreditCard.cardType(num)));
<small class="text-muted" *ngIf="type$ | async as type">
<span class="cc-brand">{{type}}</span>
</small>
Implemented in v2.0.0
Please export the directives so that user is able to use a template variable for more advanced UI stuff, like
ngIf
ing certain elements based on whether/how the card has been identified.Also, provide public api to access information, such as what the card has been identified as.
somewhere else:
or change CVC label to CID in case American Express