import { Directive , ElementRef } from '@angular/core' ; import * as Payment from 'payment' ; @ Directive ( { selector : '[ccCvc]' } ) export class CCCvcFormatDirective { constructor ( private el ) { let element = this . el . nativeElement ; Payment . fns . formatCardCVC ( element ) ; Payment . fns . restrictNumeric ( element ) ; } }