ng-pokemon-app/src/app/pokemon/pokemon.module.ts

33 lines
1.2 KiB
TypeScript
Raw Normal View History

2023-02-24 13:54:17 +00:00
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { BorderCardDirective } from './border-card.directive';
import { PokemonTypeColorPipe } from './pokemon-type-color.pipe';
import { ListPokemonComponent } from './list-pokemon/list-pokemon.component';
import { DetailPokemonComponent } from './detail-pokemon/detail-pokemon.component';
import { RouterModule, Routes } from '@angular/router';
2023-02-24 14:12:39 +00:00
import { PokemonService } from './pokemon.service';
2023-02-24 15:57:25 +00:00
import { FormsModule } from '@angular/forms';
import { PokemonFormComponent } from './pokemon-form/pokemon-form.component';
import { EditPokemonComponent } from './edit-pokemon/edit-pokemon.component';
2023-02-24 13:54:17 +00:00
const pokemonRoutes: Routes = [
2023-02-24 15:57:25 +00:00
{ path: 'edit/pokemon/:id', component: EditPokemonComponent },
2023-02-24 13:54:17 +00:00
{ path: 'pokemon/:id', component: DetailPokemonComponent },
2023-02-24 15:57:25 +00:00
{ path: 'pokemons', component: ListPokemonComponent },
2023-02-24 13:54:17 +00:00
];
@NgModule({
declarations: [
BorderCardDirective,
PokemonTypeColorPipe,
ListPokemonComponent,
DetailPokemonComponent,
2023-02-24 15:57:25 +00:00
PokemonFormComponent,
EditPokemonComponent,
2023-02-24 13:54:17 +00:00
],
2023-02-24 15:57:25 +00:00
imports: [CommonModule, FormsModule, RouterModule.forChild(pokemonRoutes)],
2023-02-24 14:12:39 +00:00
providers: [PokemonService],
2023-02-24 13:54:17 +00:00
})
export class PokemonModule {}