Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. import { Pipe, PipeTransform } from '@angular/core';
  2.  
  3. @Pipe({
  4. name: 'password'
  5. })
  6. export class PasswordPipe implements PipeTransform {
  7.  
  8. transform(value: string, activar: boolean = true): string {
  9.  
  10. if (activar) {
  11. let salida:string = "";
  12. for (let i = 0; i < value.length; i++) {
  13. salida += "*";
  14. }
  15. return salida;
  16. }else {
  17. return value;
  18. }
  19.  
  20. }
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement