Skip to content

Instantly share code, notes, and snippets.

View wilsaantos's full-sized avatar

Wilson Santos wilsaantos

View GitHub Profile
@valterh4ck3r
valterh4ck3r / cnpj.pipe.ts
Created July 13, 2018 20:42
Angular Pipe CNPJ
@Pipe({name: 'cnpj'})
export class CNPJPipe implements PipeTransform {
transform(value) {
return value.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/g,"\$1.\$2.\$3\/\$4\-\$5")
}
}