03 Add a Pokémon list view - prosoft-edv/newcomer-experience GitHub Wiki
Everything is set up now and we can start programming the first page. This will be a list view showing all existing Pokémon.
The list page should meet the following requirements:
- Should be placed in pages/list folder
- Should consist of the following files: pokemon-list.module.ts, pokemon-list.page.html, pokemon-list.page.ts and maybe pokemon-list.page.scss.
- The
SharedModulefrom the shared folder can be used to cover some required imports which will be used multiple times throughout this tutorial. It is ready to use from Step 2 and does not need further adjustments. However, it will not contain every module required for this step. - Should be accessible under http://localhost:4600/
- The route should not be lazy loaded.
- The page should display a list of Pokémon using the ps-card and ps-table components.
- The table should display the following columns:
| Column name | Type | Mandatory | Sortable | Info |
|---|---|---|---|---|
| Id | text | - | X | |
| Name | text | X | X | |
| Sprite | img | - | - | Sprite url: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/<pokemon_id>.png
|
| Pokémon-Api-Url | text | - | X |
-
httpGetPokemonList(...)from the shared/http folder and the corresponding dtos should be used to load the data. - Both 'server' and 'client' mode should be tried. Client is the more fitting solution though as the underlying api does not provide server side filtering/sorting. The datasource with server mode is therefore only configured for learning purposes and will not be used going forward.
In the end your solution should look similar to our provided example in this commit.
This concludes the creation of the list page. The tutorial continues with Step 4