Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Pipe, PipeTransform } from '@angular/core';
- @Pipe({
- name: 'password'
- })
- export class PasswordPipe implements PipeTransform {
- transform(value: string, activar: boolean = true): string {
- if (activar) {
- let salida:string = "";
- for (let i = 0; i < value.length; i++) {
- salida += "*";
- }
- return salida;
- }else {
- return value;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement