Skip to content

Instantly share code, notes, and snippets.

@wilsaantos
Created August 1, 2021 09:04
Show Gist options
  • Save wilsaantos/1f451b282883a259ff5ac0ba9b3e1fc6 to your computer and use it in GitHub Desktop.
Save wilsaantos/1f451b282883a259ff5ac0ba9b3e1fc6 to your computer and use it in GitHub Desktop.
Angular Pipe CEP Brasileiro
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'CEP' })
export class CEPPipe implements PipeTransform {
transform(cep: number) {
var sCep = cep.toString()
var fCep = sCep.substring(0,5)+'-'+sCep.substring(5)
return fCep;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment