File

src/app/pipes/mask.pipe.ts

Metadata

name mask

Methods

transform
transform(value: string)
Parameters :
Name Type Optional
value string no
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)}` : '';
  }
}

results matching ""

    No results matching ""