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
function calculateGreatestCommonDivisor(a: bigint, b: bigint) { | |
if(b === 0n) { | |
return a; | |
} | |
return calculateGreatestCommonDivisor(b, a % b); | |
} |
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, provideRouter, withComponentInputBinding } from '@angular/router'; | |
import { NgModule } from '@angular/core'; | |
import { PokemonListComponent } from './pokemon-list/pokemon-list.component'; | |
const routes: Routes = [ | |
{ path: '', pathMatch: 'full', redirectTo: 'pokemon' }, | |
{ path: 'pokemon', component: PokemonListComponent }, | |
]; |
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
mat-card { | |
transition: all 0.5s; | |
} | |
mat-card img { | |
height: 300px; | |
object-fit: contain; | |
width: 100%; | |
} |
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; | |
} | |
ngbytes-pokemon-card { | |
margin: 20px; | |
max-width: 300px; | |
} |
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
h2 { | |
margin-bottom: 10px; | |
} | |
h4 { | |
color: rgba(0,0,0,.54); | |
font-weight: normal; | |
margin-top: 0; | |
} |
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 } from '@angular/router'; | |
import { Component, OnInit } from '@angular/core'; | |
import { Pokemon, PokemonService } from '../pokemon.service'; | |
import { CommonModule } from '@angular/common'; | |
import { MatButtonModule } from '@angular/material/button'; | |
@Component({ | |
selector: 'app-pokemon-detail', | |
standalone: true, |
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.imageUrl" alt="Photo of a Pokemon" /> | |
<div> | |
<p>Attack: {{ pokemon.attack }}</p> | |
<p>Defense: {{ pokemon.defense }}</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
import { RouterModule, Routes, provideRouter, withComponentInputBinding } from '@angular/router'; | |
import { NgModule } from '@angular/core'; | |
import { PokemonListComponent } from './pokemon-list/pokemon-list.component'; | |
const routes: Routes = [ | |
{ path: '', pathMatch: 'full', redirectTo: 'pokemon' }, | |
{ | |
path: 'pokemon', | |
component: PokemonListComponent, |
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'; | |
import { PokemonListComponent } from './pokemon-list/pokemon-list.component'; | |
const routes: Routes = [ | |
{ path: '', pathMatch: 'full', redirectTo: 'pokemon' }, | |
{ path: 'pokemon', component: PokemonListComponent }, | |
]; |
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
<h1>Standalone Pokedex</h1> | |
<router-outlet></router-outlet> |
NewerOlder