Created
August 1, 2021 09:04
-
-
Save wilsaantos/1f451b282883a259ff5ac0ba9b3e1fc6 to your computer and use it in GitHub Desktop.
Angular Pipe CEP Brasileiro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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