From 31469cb7afe59a7c6f8e9dee3e39448017038ae5 Mon Sep 17 00:00:00 2001 From: Kappy Date: Mon, 13 Nov 2017 01:22:50 +0900 Subject: [PATCH 1/2] translate: tutorial/toh-pt2.md --- aio-ja/content/tutorial/toh-pt2.md | 206 ++++++++++++++--------------- 1 file changed, 98 insertions(+), 108 deletions(-) diff --git a/aio-ja/content/tutorial/toh-pt2.md b/aio-ja/content/tutorial/toh-pt2.md index c8c54bd590..02faf09d34 100644 --- a/aio-ja/content/tutorial/toh-pt2.md +++ b/aio-ja/content/tutorial/toh-pt2.md @@ -1,207 +1,197 @@ -# Display a Heroes 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. +このページでは「Tour of Heroes」アプリを拡張してヒーローのリストを表示し、ユーザーがヒーローを選択してヒーローの詳細を表示できるようにします。 -## Create mock heroes +## ヒーローのmockを作成する -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. +最終的には、リモートのデータサーバーからそれらのヒーローを取得します。 +ひとまず、サーバーからデータが返ってきたと仮定して _ヒーローのmock_ を作成しましょう。 -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. +`mock-heroes.ts` と呼ばれるファイルを `src/app/` フォルダに作成してください。 +`HEROES` 定数を10人のヒーローの配列として定義し、エクスポートしてください。 +ファイルは次のようになるでしょう。 -## Displaying heroes +## ヒーローを表示する -You're about to display the list of heroes at the top of the `HeroesComponent`. +あなたは `HeroesComponent` の1番上にヒーローのリストを表示しようとしています。 -Open the `HeroesComponent` class file and import the mock `HEROES`. +`HeroesComponent` クラスのファイルを開いて `HEROES` mockをインポートしてください。 -Add a `heroes` property to the class that exposes these heroes for binding. +これらのヒーローをバインディングするために、ヒーローを公開するクラスに `heroes` プロパティを追加してください。 -### List heroes with _*ngFor_ +### _*ngFor_ でヒーローを一覧表示する -Open the `HeroesComponent` template file and make the following changes: +`HeroesComponent` テンプレートを開き、次のように変更してください: -* Add an `

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