|
1 | | -# Add a property binding to a component’s template |
| 1 | +# コンポーネントのテンプレートにプロパティバインディングを追加する |
2 | 2 |
|
3 | | -This tutorial lesson demonstrates how to add property binding to a template and use it to pass dynamic data to components. |
| 3 | +このチュートリアルレッスンではテンプレートにプロパティバインディングを追加する方法とコンポーネントに動的データを渡すための使用方法を紹介します。 |
4 | 4 |
|
5 | 5 | <docs-video src="https://www.youtube.com/embed/eM3zi_n7lNs?si=AsiczpWnMz5HhJqB&start=599"/> |
6 | 6 |
|
7 | | -## What you'll learn |
| 7 | +## 何を学ぶか |
8 | 8 |
|
9 | | -- Your app has data bindings in the `Home` template. |
10 | | -- Your app sends data from the `Home` to the `HousingLocation`. |
| 9 | +- アプリケーションの`Home`テンプレートにデータバインディングが追加されます。 |
| 10 | +- アプリケーションが`Home`から`HousingLocation`にデータを送れるようになります。 |
11 | 11 |
|
12 | | -## Conceptual preview of Inputs |
| 12 | +## inputプロパティのコンセプト概要 |
13 | 13 |
|
14 | | -In this lesson, you'll continue the process of sharing data from the parent component to the child component by binding data to those properties in the template using property binding. |
| 14 | +このレッスンでは、プロパティバインディングを使ってテンプレート内のプロパティに値を渡し、親コンポーネントから子コンポーネントへデータを共有する方法を続けて学びます。 |
15 | 15 |
|
16 | | -Property binding enables you to connect a variable to an `Input` in an Angular template. The data is then dynamically bound to the `Input`. |
| 16 | +プロパティバインディングを使うと、Angularテンプレート内で変数を`Input`プロパティに結びつけることができます。こうして渡されたデータは`Input`に動的にバインドされます。 |
17 | 17 |
|
18 | | -For a more in depth explanation, please refer to the [Property binding](/guide/templates/binding#css-class-and-style-property-bindings) guide. |
| 18 | +より詳しい説明は、ガイドの[プロパティバインディング](/guide/templates/binding#css-class-and-style-property-bindings)を参照してください。 |
19 | 19 |
|
20 | 20 | <docs-workflow> |
21 | 21 |
|
22 | | -<docs-step title="Update the `Home` template"> |
23 | | -This step adds property binding to the `<app-housing-location>` tag. |
| 22 | +<docs-step title="`Home`テンプレートを更新する"> |
| 23 | +このステップでは、`<app-housing-location>`タグにプロパティバインディングを追加します。 |
24 | 24 |
|
25 | | -In the code editor: |
| 25 | +コードエディタで、 |
26 | 26 |
|
27 | | -1. Navigate to `src/app/home/home.ts` |
28 | | -1. In the template property of the `@Component` decorator, update the code to match the code below: |
29 | | - <docs-code language="angular-ts" header="Add housingLocation property binding" path="adev/src/content/tutorials/first-app/steps/07-dynamic-template-values/src/app/home/home.ts" visibleLines="[15,17]"/> |
| 27 | +1. `src/app/home/home.ts`に移動します |
| 28 | +1. `@Component`のテンプレートプロパティで、以下のコードと同じ内容になるよう更新します。 |
| 29 | + <docs-code language="angular-ts" header="housingLocationプロパティバインディングを追加する" path="adev/src/content/tutorials/first-app/steps/07-dynamic-template-values/src/app/home/home.ts" visibleLines="[15,17]"/> |
30 | 30 |
|
31 | | - When adding a property binding to a component tag, we use the `[attribute] = "value"` syntax to notify Angular that the assigned value should be treated as a property from the component class and not a string value. |
| 31 | + コンポーネントタグにプロパティバインディングを追加する際には、`[attribute] = "value"`という構文を使います。これは割り当てた値を文字列ではなくコンポーネントクラスのプロパティとして扱うようAngularに指示するためのものです。 |
32 | 32 |
|
33 | | - The value on the right-hand side is the name of the property from the `Home`. |
| 33 | + 右辺の値は`Home`コンポーネントのプロパティの名です。 |
34 | 34 |
|
35 | 35 | </docs-step> |
36 | 36 |
|
37 | | -<docs-step title="Confirm the code still works"> |
38 | | -1. Save your changes and confirm the app does not have any errors. |
39 | | -1. Correct any errors before you continue to the next step. |
| 37 | +<docs-step title="コードが正しく動作することを確認する"> |
| 38 | +1. 変更を保存し、アプリケーションにエラーがないことを確認します。 |
| 39 | +1. 次のステップに進む前に、エラーがあれば修正します。 |
40 | 40 | </docs-step> |
41 | 41 |
|
42 | 42 | </docs-workflow> |
43 | 43 |
|
44 | | -SUMMARY: In this lesson, you added a new property binding and passed in a reference to a class property. Now, the `HousingLocation` has access to data that it can use to customize the component's display. |
| 44 | +SUMMARY: このレッスンでは、新しいプロパティバインディングを追加し、クラスプロパティへの参照を渡しました。これにより、`HousingLocation`はコンポーネントの表示をカスタマイズするために利用可能なデータにアクセスできるようになりました。 |
45 | 45 |
|
46 | | -For more information about the topics covered in this lesson, visit: |
| 46 | +このレッスンで扱った内容について、さらに詳しく知りたい場合は次のページをご覧ください: |
47 | 47 |
|
48 | 48 | <docs-pill-row> |
49 | | - <docs-pill href="/guide/templates/binding#css-class-and-style-property-bindings" title="Property binding"/> |
| 49 | + <docs-pill href="/guide/templates/binding#css-class-and-style-property-bindings" title="プロパティのバインディング"/> |
50 | 50 | </docs-pill-row> |
0 commit comments