This file contains hidden or 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
.card-container { | |
display: flex; | |
flex-wrap: wrap; | |
justify-content: space-between; | |
padding: 30px; | |
mat-card { | |
align-items: center; | |
display: flex; | |
flex: 1 0 20%; |
This file contains hidden or 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
.detail { | |
border-radius: 15px; | |
box-shadow: 0 0 11px #cacaca; | |
padding: 30px; | |
button { | |
margin-right: 10px; | |
} | |
h2 { |
This file contains hidden or 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
form { | |
display: flex; | |
flex-direction: column; | |
} | |
mat-form-field { | |
margin: 10px; | |
} |
This file contains hidden or 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
import { CollectionReference, DocumentData, addDoc, collection, deleteDoc, doc, updateDoc } from '@firebase/firestore'; | |
import { Firestore, collectionData, docData } from '@angular/fire/firestore'; | |
import { Injectable } from '@angular/core'; | |
import { Observable } from 'rxjs'; | |
import { Pokemon } from '../features/pokemon/interfaces/pokemon.interface'; // Don't forget to import the interface!! | |
@Injectable({ | |
providedIn: 'root', | |
}) | |
export class PokedexFirestoreService {} |
This file contains hidden or 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
export interface Pokemon { | |
height: number; | |
id: string; | |
description: string; | |
imgUrl: string; | |
name: string; | |
type: string; | |
weight: number; | |
} |
This file contains hidden or 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
import { CommonModule } from '@angular/common'; | |
import { FormComponent } from './components/form/form.component'; | |
import { MatButtonModule } from '@angular/material/button'; | |
import { MatCardModule } from '@angular/material/card'; | |
import { MatDialogModule } from '@angular/material/dialog'; | |
import { MatFormFieldModule } from '@angular/material/form-field'; | |
import { MatInputModule } from '@angular/material/input'; | |
import { NgModule } from '@angular/core'; | |
import { PokemonComponent } from './pokemon.component'; | |
import { PokemonRoutingModule } from './pokemon-routing.module'; |
This file contains hidden or 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
import { RouterModule, Routes } from '@angular/router'; | |
import { NgModule } from '@angular/core'; | |
const routes: Routes = [ | |
{ | |
path: '', | |
loadChildren: () => | |
import('./features/pokemon/pokemon.module').then((m) => m.PokemonModule), | |
}, |
This file contains hidden or 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
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; | |
import { Pokemon } from '../../interfaces/pokemon.interface'; | |
@Component({ | |
selector: 'app-detail', | |
templateUrl: './detail.component.html', | |
styleUrls: ['./detail.component.scss'], | |
}) | |
export class DetailComponent implements OnInit { |
This file contains hidden or 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
<div class="detail"> | |
<h2>{{ pokemon.name }}</h2> | |
<h4>{{ pokemon.type }} type</h4> | |
<div class="content"> | |
<img [src]="pokemon.imgUrl" /> | |
<div> | |
<p>Height: {{ pokemon.height }}</p> | |
<p>Weight: {{ pokemon.weight }}</p> | |
<p> | |
{{ pokemon.description }} |
This file contains hidden or 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
.header { | |
display: flex; | |
justify-content: center; | |
img { | |
height: 150px; | |
margin-bottom: 60px; | |
} | |
} |