-
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.
Ajustes del código y nuevo componente digimons-individual
- Loading branch information
1 parent
0b364c4
commit 6c1ff2d
Showing
29 changed files
with
156 additions
and
171 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
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 |
---|---|---|
@@ -1,17 +1,18 @@ | ||
import { Component } from '@angular/core'; | ||
import { DigiAPI } from './../interfaces'; | ||
import { ArregloDigimon } from './../interfaces'; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.css'] | ||
}) | ||
export class AppComponent { | ||
public digimons:Array<DigiAPI>; | ||
public digimones: Array<ArregloDigimon>; //declaro una variable arreglo de los datos de la interfaz | ||
|
||
exportDigimons(digimons:Array<DigiAPI>):void{ | ||
if(this.digimons !== digimons){ | ||
this.digimons = digimons; | ||
} | ||
mostrarPokemonOrigen(digimones: Array<ArregloDigimon>):void{//metodo que retorna un array de digimon interfaz | ||
if(this.digimones !== digimones){//Si es distinto lo igualo al parametro entrada | ||
this.digimones = digimones; | ||
} | ||
|
||
} | ||
} |
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
3 changes: 0 additions & 3 deletions
3
src/app/components/digimons-buscador/digimon-id/digimon-id.component.html
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
src/app/components/digimons-buscador/digimon-id/digimon-id.component.ts
This file was deleted.
Oops, something went wrong.
Empty file.
3 changes: 0 additions & 3 deletions
3
src/app/components/digimons-buscador/digimon-nivel/digimon-nivel.component.html
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
src/app/components/digimons-buscador/digimon-nivel/digimon-nivel.component.ts
This file was deleted.
Oops, something went wrong.
Empty file removed
0
src/app/components/digimons-buscador/digimon-nombre/digimon-nombre.component.css
Empty file.
3 changes: 0 additions & 3 deletions
3
src/app/components/digimons-buscador/digimon-nombre/digimon-nombre.component.html
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
src/app/components/digimons-buscador/digimon-nombre/digimon-nombre.component.ts
This file was deleted.
Oops, something went wrong.
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
src/app/components/digimons-buscador/digimons-buscador.component.html
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,3 @@ | ||
<p> | ||
digimons-buscador works! | ||
</p> |
15 changes: 15 additions & 0 deletions
15
src/app/components/digimons-buscador/digimons-buscador.component.ts
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 { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-digimons-buscador', | ||
templateUrl: './digimons-buscador.component.html', | ||
styleUrls: ['./digimons-buscador.component.css'] | ||
}) | ||
export class DigimonsBuscadorComponent implements OnInit { | ||
|
||
constructor() { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
} |
30 changes: 0 additions & 30 deletions
30
src/app/components/digimons-home/digimons-home.component.css
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 |
---|---|---|
@@ -1,30 +0,0 @@ | ||
.card-columns .card { | ||
transition: all 0.3s linear; | ||
-webkit-transition: all 0.3s linear; | ||
} | ||
|
||
.card-columns .card:hover { | ||
box-shadow: 0px 0px 10px #5f7484; | ||
cursor: pointer; | ||
} | ||
|
||
.card-columns .card .card-body .card-title { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.card-columns .card .card-body .card-title .identificador { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
color: black; | ||
border-radius: 100%; | ||
font-weight: bold; | ||
width: 50px; | ||
height: 50px; | ||
background: white; | ||
border: 2px solid black; | ||
margin: 0 10px 0 0; | ||
padding: 5px; | ||
text-align: center; | ||
} | ||
14 changes: 2 additions & 12 deletions
14
src/app/components/digimons-home/digimons-home.component.html
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 |
---|---|---|
@@ -1,17 +1,7 @@ | ||
<div class="loading" *ngIf="!digimonsCargados"> | ||
Loading Digimons ... | ||
</div> | ||
|
||
<div class="card-columns" *ngIf="digimonsCargados && digimons"> | ||
<div class="card" *ngFor="let digi of digimons; let i = index"> | ||
<div class="card-block"> | ||
<div class="card-body"> | ||
<h5 class="card-title"><span class="identificador">{{digi.id}} </span> {{digi.name | uppercase}}</h5> | ||
</div> | ||
<img [src]="digi.img" class="img-fluid card-img-top" [alt]="digi.name" [title]="digi.name"> | ||
<div class="card-footer"> | ||
<small class="text-muted">{{digi.level}}</small> | ||
</div> | ||
</div> | ||
</div> | ||
<!-- Es toda la información de un digimon alojada en un componente hijo --> | ||
<app-digimons-individual [index]="i" [digimon_individual]="miDigimon" *ngFor="let miDigimon of digimons; let i = index"></app-digimons-individual> | ||
</div> |
25 changes: 0 additions & 25 deletions
25
src/app/components/digimons-home/digimons-home.component.spec.ts
This file was deleted.
Oops, something went wrong.
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
30 changes: 30 additions & 0 deletions
30
src/app/components/digimons-individual/digimons-individual.component.css
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,30 @@ | ||
.card { | ||
transition: all 0.3s linear; | ||
-webkit-transition: all 0.3s linear; | ||
} | ||
|
||
.card:hover { | ||
box-shadow: 0px 0px 10px #5f7484; | ||
cursor: pointer; | ||
} | ||
|
||
.card .card-body .card-title { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.card .card-body .card-title .identificador { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
color: black; | ||
border-radius: 100%; | ||
font-weight: bold; | ||
width: 50px; | ||
height: 50px; | ||
background: white; | ||
border: 2px solid black; | ||
margin: 0 10px 0 0; | ||
padding: 5px; | ||
text-align: center; | ||
} |
11 changes: 11 additions & 0 deletions
11
src/app/components/digimons-individual/digimons-individual.component.html
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,11 @@ | ||
<div class="card"> | ||
<div class="card-block"> | ||
<div class="card-body"> | ||
<h5 class="card-title"><span class="identificador">{{digimon_individual.id}} </span> {{digimon_individual.name | uppercase}}</h5> | ||
</div> | ||
<img [src]="digimon_individual.img" class="img-fluid card-img-top" [alt]="digimon_individual.name" [title]="digimon_individual.name"> | ||
<div class="card-footer"> | ||
<small class="text-muted">{{digimon_individual.level | uppercase}}</small> | ||
</div> | ||
</div> | ||
</div> |
18 changes: 18 additions & 0 deletions
18
src/app/components/digimons-individual/digimons-individual.component.ts
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,18 @@ | ||
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-digimons-individual', | ||
templateUrl: './digimons-individual.component.html', | ||
styleUrls: ['./digimons-individual.component.css'] | ||
}) | ||
export class DigimonsIndividualComponent implements OnInit { | ||
|
||
@Input() digimon_individual:any = {} //Llamo el evento input (hijo de padre) para usarlo en el componente principal | ||
@Input() index: number; //Capturo el index del for | ||
|
||
constructor() { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -1,23 +1,27 @@ | ||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark"> | ||
<a class="navbar-brand" [routerLink]="['home']">Digimons</a> | ||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
<div class="collapse navbar-collapse" id="navbarNav"> | ||
<ul class="navbar-nav"> | ||
<li class="nav-item active"> | ||
<a class="nav-link" [routerLink]="['home']">Inicio <span class="sr-only">(current)</span></a> | ||
<a class="navbar-brand" [routerLink]="['home']"> | ||
<img src="assets/img/logo.png" alt="agumon" width="100" height="50" title="Inicio"> | ||
</a> | ||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
|
||
<div class="collapse navbar-collapse" id="navbarSupportedContent"> | ||
<ul class="navbar-nav mr-auto"> | ||
<li class="nav-item" routerLinkActive="active"> | ||
<a class="nav-link " [routerLink]="[ 'home'] ">Inicio <span class="sr-only ">(current)</span></a> | ||
</li> | ||
<li class="nav-item dropdown"> | ||
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | ||
Buscar por | ||
</a> | ||
<div class="dropdown-menu" aria-labelledby="navbarDropdown"> | ||
<a class="dropdown-item" [routerLink]="['digimonsId']" routerLinkActive="active">ID</a> | ||
<a class="dropdown-item" [routerLink]="['digimonsNombre']" routerLinkActive="active">Nombre</a> | ||
<a class="dropdown-item" [routerLink]="['digimonsNivel']" routerLinkActive="active">Nivel</a> | ||
</div> | ||
<li class="nav-item" routerLinkActive="active "> | ||
<a class="nav-link" [routerLink]="[ 'buscador'] ">Buscar</a> | ||
</li> | ||
</ul> | ||
<!--<form class="form-inline my-2 my-lg-0 "> | ||
<input class="form-control mr-sm-2 " type="text " [(ngModel)]="search " (ngModelChange)="searchEvent() " (keyup.enter)="searchEvent() " placeholder="id, nombre, nivel " aria-label="Search "> | ||
<button class="btn btn-outline-success my-2 my-sm-0 " *ngIf="search " type="button " (click)="searchEvent( '') ">Buscar Digimon</button> | ||
</form>--> | ||
<form class="form-inline my-2 my-lg-0 "> | ||
<input class="form-control mr-sm-2 " type="search " placeholder="id, nombre, nivel " aria-label="Search "> | ||
<button class="btn btn-outline-secondary my-2 my-sm-0 " type="submit ">Buscar</button> | ||
</form> | ||
</div> | ||
</nav> |
Oops, something went wrong.