-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Diego Guzmán
committed
Feb 21, 2018
1 parent
bfb69e0
commit bd6dfb4
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Pipe, PipeTransform } from '@angular/core'; | ||
|
||
@Pipe({ | ||
name: 'contrasena' | ||
}) | ||
export class ContrasenaPipe implements PipeTransform { | ||
|
||
transform(value: string, activar: boolean = true): string { | ||
if (activar) { | ||
return value.replace(/./g, '*'); | ||
} | ||
else return value; | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Pipe, PipeTransform } from '@angular/core'; | ||
//import para asegurarnos que el codigo q se va a poner esté limpio | ||
import { DomSanitizer } from '@angular/platform-browser'; | ||
@Pipe({ | ||
name: 'domseguro' | ||
}) | ||
export class DomseguroPipe implements PipeTransform { | ||
|
||
//decalro en constructore para inicializarlo y usarlo | ||
constructor(private domSanitizer: DomSanitizer) { } | ||
|
||
transform(value: string, url: string): any { | ||
|
||
return this.domSanitizer.bypassSecurityTrustResourceUrl(url + value); | ||
} | ||
|
||
} |