From be82fd53d7d76e7cf9657c7e1717f9ec9c549e22 Mon Sep 17 00:00:00 2001 From: Antonio Cardenas Date: Wed, 21 Oct 2020 20:39:26 -0600 Subject: [PATCH 1/3] cambios de sintaxicos --- aio/content/tutorial/toh-pt2.en.md | 253 +++++++++++++++++++++++++++++ aio/content/tutorial/toh-pt2.md | 220 ++++++++++++------------- 2 files changed, 355 insertions(+), 118 deletions(-) create mode 100644 aio/content/tutorial/toh-pt2.en.md diff --git a/aio/content/tutorial/toh-pt2.en.md b/aio/content/tutorial/toh-pt2.en.md new file mode 100644 index 0000000000000..ce094dac3f499 --- /dev/null +++ b/aio/content/tutorial/toh-pt2.en.md @@ -0,0 +1,253 @@ +# Display a selection list + +In this page, you'll expand the Tour of Heroes app to display a list of heroes, and +allow users to select a hero and display the hero's details. + +
+ + For the sample app that this page describes, see the . + +
+ + +## Create mock heroes + +You'll need some heroes to display. + +Eventually you'll get them from a remote data server. +For now, you'll create some _mock heroes_ and pretend they came from the server. + +Create a file called `mock-heroes.ts` in the `src/app/` folder. +Define a `HEROES` constant as an array of ten heroes and export it. +The file should look like this. + + + +## Displaying heroes + +Open the `HeroesComponent` class file and import the mock `HEROES`. + + + + +In the same file (`HeroesComponent` class), define a component property called `heroes` to expose the `HEROES` array for binding. + + + + +### List heroes with `*ngFor` + +Open the `HeroesComponent` template file and make the following changes: + +* Add an `

` at the top, +* Below it add an HTML unordered list (`