src/app/pipes/mask.pipe.ts
name | mask |
transform | ||||||
transform(value: string)
|
||||||
Defined in src/app/pipes/mask.pipe.ts:7
|
||||||
Parameters :
Returns :
string
|
import { MASKLENGTH } from '../app.constants';
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'mask'
})
export class MaskPipe implements PipeTransform {
transform(value: string): string {
const length = MASKLENGTH ? MASKLENGTH : 5; // note defaults to 5 if MAXLENGTH is 0
return value ? `*${value.substr(-length)}` : '';
}
}