diff --git a/2. spa/src/app/components/heroe-tarjeta/heroe-tarjeta.component.ts b/2. spa/src/app/components/heroe-tarjeta/heroe-tarjeta.component.ts index 8da2cc1..4c971d3 100644 --- a/2. spa/src/app/components/heroe-tarjeta/heroe-tarjeta.component.ts +++ b/2. spa/src/app/components/heroe-tarjeta/heroe-tarjeta.component.ts @@ -20,7 +20,7 @@ export class HeroeTarjetaComponent implements OnInit { ngOnInit() { } - verHeroe(){ + verHeroe() { // this.heroeSeleccionado.emit(this.index); this.router.navigate( ['/heroe', this.index]); // console.log(this.index); diff --git a/3. pipes/src/app/app.component.ts b/3. pipes/src/app/app.component.ts index 0b50c0b..c752a9a 100644 --- a/3. pipes/src/app/app.component.ts +++ b/3. pipes/src/app/app.component.ts @@ -15,17 +15,17 @@ export class AppComponent { PI = Math.PI; - a: number = 0.234; + a = 0.234; salario = 1234.5; heroe = { - nombre: "logan", - clave: "Wolverine", + nombre: 'logan', + clave: 'Wolverine', edad: 500, - dirección:{ - calle: "Primera", - casa: "29" + dirección: { + calle: 'Primera', + casa: '29' } }; diff --git a/3. pipes/src/app/pipes/capitalizado.pipe.ts b/3. pipes/src/app/pipes/capitalizado.pipe.ts index 857bd9a..41b3391 100644 --- a/3. pipes/src/app/pipes/capitalizado.pipe.ts +++ b/3. pipes/src/app/pipes/capitalizado.pipe.ts @@ -4,15 +4,14 @@ import { Pipe, PipeTransform } from '@angular/core'; export class Capitalizado implements PipeTransform { transform(value: string, todas: boolean = true ): string { value = value.toLowerCase(); - let nombres = value.split(' '); + const nombres = value.split(' '); - if(todas){ + if ( todas ) { // tslint:disable-next-line:forin - for(let i in nombres ){ + for (const i in nombres ) { nombres[i] = nombres[i][0].toUpperCase() + nombres[i].substr(1); } - } - else { + } else { nombres[0] = nombres[0][0].toLocaleUpperCase() + nombres[0].substr(1); } diff --git a/3. pipes/src/app/pipes/contrasena.pipe.ts b/3. pipes/src/app/pipes/contrasena.pipe.ts index 8597379..912a13a 100644 --- a/3. pipes/src/app/pipes/contrasena.pipe.ts +++ b/3. pipes/src/app/pipes/contrasena.pipe.ts @@ -6,7 +6,7 @@ import { Pipe, PipeTransform } from '@angular/core'; export class ContrasenaPipe implements PipeTransform { transform(value: string, activo: boolean): any { - let RegEXP = /(\w+)\s(\w+)/; + const RegEXP = /(\w+)\s(\w+)/; if (activo) { value = value.replace( RegEXP, '**********' ); console.log(value); diff --git a/3. pipes/src/app/pipes/domseguro.pipe.ts b/3. pipes/src/app/pipes/domseguro.pipe.ts index 6679938..bbcaa80 100644 --- a/3. pipes/src/app/pipes/domseguro.pipe.ts +++ b/3. pipes/src/app/pipes/domseguro.pipe.ts @@ -7,7 +7,7 @@ import { DomSanitizer } from '@angular/platform-browser'; }) export class DomseguroPipe implements PipeTransform { - constructor ( private domSanitizer: DomSanitizer){ } + constructor( private domSanitizer: DomSanitizer) { } transform(value: string, url: string): any { return this.domSanitizer.bypassSecurityTrustResourceUrl( url + value ); } diff --git a/3. pipes/src/index.html b/3. pipes/src/index.html index dad3b2c..805b7f7 100644 --- a/3. pipes/src/index.html +++ b/3. pipes/src/index.html @@ -7,10 +7,17 @@ + + + +