Skip to content

Commit 7900d08

Browse files
committed
06-property-bindingの和訳を作成
1 parent 19fb019 commit 7900d08

2 files changed

Lines changed: 73 additions & 23 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Add a property binding to a component’s template
2+
3+
This tutorial lesson demonstrates how to add property binding to a template and use it to pass dynamic data to components.
4+
5+
<docs-video src="https://www.youtube.com/embed/eM3zi_n7lNs?si=AsiczpWnMz5HhJqB&amp;start=599"/>
6+
7+
## What you'll learn
8+
9+
- Your app has data bindings in the `Home` template.
10+
- Your app sends data from the `Home` to the `HousingLocation`.
11+
12+
## Conceptual preview of Inputs
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.
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`.
17+
18+
For a more in depth explanation, please refer to the [Property binding](/guide/templates/binding#css-class-and-style-property-bindings) guide.
19+
20+
<docs-workflow>
21+
22+
<docs-step title="Update the `Home` template">
23+
This step adds property binding to the `<app-housing-location>` tag.
24+
25+
In the code editor:
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]"/>
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.
32+
33+
The value on the right-hand side is the name of the property from the `Home`.
34+
35+
</docs-step>
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.
40+
</docs-step>
41+
42+
</docs-workflow>
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.
45+
46+
For more information about the topics covered in this lesson, visit:
47+
48+
<docs-pill-row>
49+
<docs-pill href="/guide/templates/binding#css-class-and-style-property-bindings" title="Property binding"/>
50+
</docs-pill-row>
Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
1-
# Add a property binding to a component’s template
1+
# コンポーネントのテンプレートにプロパティバインディングを追加する
22

3-
This tutorial lesson demonstrates how to add property binding to a template and use it to pass dynamic data to components.
3+
このチュートリアルレッスンではテンプレートにプロパティバインディングを追加する方法とコンポーネントに動的データを渡すための使用方法を紹介します。
44

55
<docs-video src="https://www.youtube.com/embed/eM3zi_n7lNs?si=AsiczpWnMz5HhJqB&amp;start=599"/>
66

7-
## What you'll learn
7+
## 何を学ぶか
88

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`にデータを送れるようになります。
1111

12-
## Conceptual preview of Inputs
12+
## inputプロパティのコンセプト概要
1313

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+
このレッスンでは、プロパティバインディングを使ってテンプレート内のプロパティに値を渡し、親コンポーネントから子コンポーネントへデータを共有する方法を続けて学びます。
1515

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`に動的にバインドされます。
1717

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)を参照してください。
1919

2020
<docs-workflow>
2121

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>`タグにプロパティバインディングを追加します。
2424

25-
In the code editor:
25+
コードエディタで、
2626

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]"/>
3030

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に指示するためのものです。
3232

33-
The value on the right-hand side is the name of the property from the `Home`.
33+
右辺の値は`Home`コンポーネントのプロパティの名です。
3434

3535
</docs-step>
3636

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. 次のステップに進む前に、エラーがあれば修正します。
4040
</docs-step>
4141

4242
</docs-workflow>
4343

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`はコンポーネントの表示をカスタマイズするために利用可能なデータにアクセスできるようになりました。
4545

46-
For more information about the topics covered in this lesson, visit:
46+
このレッスンで扱った内容について、さらに詳しく知りたい場合は次のページをご覧ください:
4747

4848
<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="プロパティのバインディング"/>
5050
</docs-pill-row>

0 commit comments

Comments
 (0)