Skip to content

Commit fe0111c

Browse files
authored
feat(docs): translate signal forms tutorial to Japanese (#1096)
Translate the complete Signal Forms tutorial, including: - Introduction page - 6 step-by-step lessons covering form models, field binding, validation, error display, and form submission - Configuration files for all tutorial steps All translations include .en.md/.en.json backup files for diff tracking.
1 parent ecdccce commit fe0111c

File tree

28 files changed

+577
-137
lines changed

28 files changed

+577
-137
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Learn Angular Signal Forms
2+
3+
This interactive tutorial will teach you how to build reactive forms using Angular's experimental Signal Forms API.
4+
5+
IMPORTANT: Signal Forms is currently [experimental](reference/releases#experimental). The API may change before stabilizing. Check the [official documentation](guide/forms/signal-forms) for the latest updates.
6+
7+
## How to use this tutorial
8+
9+
This tutorial assumes you understand Angular's core concepts and have basic familiarity with signals. If you're new to Angular, read our [essentials guide](/essentials). If you're new to signals, complete the [signals tutorial](/tutorials/signals) first.
10+
11+
Each step represents a concept in Signal Forms. You'll build a complete login form from scratch, learning the fundamentals step by step.
12+
13+
**Your learning path:**
14+
15+
1. Set up the form model with TypeScript and signals
16+
2. Connect the form to your template
17+
3. Add validation rules
18+
4. Display validation errors to users
19+
5. Handle form submission
20+
6. Explore advanced topics and next steps
21+
22+
If you get stuck, click "Reveal answer" at the top.
23+
24+
Alright, let's [get started](/tutorials/signal-forms/1-set-up-form-model)!
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
# Learn Angular Signal Forms
1+
# Angularシグナルフォームを学ぶ
22

3-
This interactive tutorial will teach you how to build reactive forms using Angular's experimental Signal Forms API.
3+
このインタラクティブなチュートリアルでは、Angularの実験的なシグナルフォームAPIを使用してリアクティブフォームを構築する方法を学びます。
44

5-
IMPORTANT: Signal Forms is currently [experimental](reference/releases#experimental). The API may change before stabilizing. Check the [official documentation](guide/forms/signal-forms) for the latest updates.
5+
IMPORTANT: シグナルフォームは現在[実験的](reference/releases#experimental)です。安定化する前にAPIが変更される可能性があります。最新の更新については[公式ドキュメント](guide/forms/signal-forms)を確認してください。
66

7-
## How to use this tutorial
7+
## このチュートリアルの使い方 {#how-to-use-this-tutorial}
88

9-
This tutorial assumes you understand Angular's core concepts and have basic familiarity with signals. If you're new to Angular, read our [essentials guide](/essentials). If you're new to signals, complete the [signals tutorial](/tutorials/signals) first.
9+
このチュートリアルは、Angularのコア概念を理解しており、シグナルの基本的な知識があることを前提としています。Angularが初めての場合は、[基本ガイド](/essentials)を読んでください。シグナルが初めての場合は、まず[シグナルチュートリアル](/tutorials/signals)を完了してください。
1010

11-
Each step represents a concept in Signal Forms. You'll build a complete login form from scratch, learning the fundamentals step by step.
11+
各ステップはシグナルフォームのコンセプトを表しています。ゼロから完全なログインフォームを構築し、基礎を段階的に学びます。
1212

13-
**Your learning path:**
13+
**学習パス:**
1414

15-
1. Set up the form model with TypeScript and signals
16-
2. Connect the form to your template
17-
3. Add validation rules
18-
4. Display validation errors to users
19-
5. Handle form submission
20-
6. Explore advanced topics and next steps
15+
1. TypeScriptとシグナルを使用してフォームモデルを設定
16+
2. フォームをテンプレートに接続
17+
3. バリデーションルールを追加
18+
4. バリデーションエラーをユーザーに表示
19+
5. フォーム送信を処理
20+
6. 高度なトピックと次のステップを探索
2121

22-
If you get stuck, click "Reveal answer" at the top.
22+
詰まった場合は、上部の「答えを表示」をクリックしてください。
2323

24-
Alright, let's [get started](/tutorials/signal-forms/1-set-up-form-model)!
24+
それでは、[始めましょう](/tutorials/signal-forms/1-set-up-form-model)!
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"title": "Learn Angular Signal Forms",
3+
"type": "editor",
4+
"nextTutorial": "signals",
5+
"openFiles": ["src/app/app.ts", "src/app/app.html", "src/app/app.css"]
6+
}

adev-ja/src/content/tutorials/signal-forms/intro/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"title": "Learn Angular Signal Forms",
2+
"title": "Angularシグナルフォームを学ぶ",
33
"type": "editor",
44
"nextTutorial": "signals",
55
"openFiles": ["src/app/app.ts", "src/app/app.html", "src/app/app.css"]
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Set up the form model
2+
3+
Every Signal Form starts with a form data model - a signal that defines the shape of your data, and stores your form data.
4+
5+
In this lesson, you'll learn how to:
6+
7+
- Define a TypeScript interface for your form data
8+
- Create a signal to hold form values
9+
- Use the `form()` function to create a Signal Form
10+
11+
Let's build the foundation for our login form!
12+
13+
<hr />
14+
15+
<docs-workflow>
16+
17+
<docs-step title="Define the LoginData interface">
18+
Create a TypeScript interface that defines the structure of your login form data. The form will have:
19+
20+
- An `email` field (string)
21+
- A `password` field (string)
22+
- A `rememberMe` field (boolean)
23+
24+
```ts
25+
interface LoginData {
26+
email: string;
27+
password: string;
28+
rememberMe: boolean;
29+
}
30+
```
31+
32+
Add this interface above the `@Component` decorator.
33+
</docs-step>
34+
35+
<docs-step title="Import signal and form">
36+
Import the `signal` function from `@angular/core` and the `form` function from `@angular/forms/signals`:
37+
38+
```ts
39+
import { Component, signal } from '@angular/core';
40+
import { form } from '@angular/forms/signals';
41+
```
42+
43+
</docs-step>
44+
45+
<docs-step title="Create the form model signal">
46+
In your component class, create a `loginModel` signal with initial values. Use the `LoginData` interface as the type parameter:
47+
48+
```ts
49+
loginModel = signal<LoginData>({
50+
email: '',
51+
password: '',
52+
rememberMe: false,
53+
});
54+
```
55+
56+
The initial values start as empty strings for text fields and `false` for the checkbox.
57+
</docs-step>
58+
59+
<docs-step title="Create the form">
60+
Now create the form by passing your model signal to the `form()` function:
61+
62+
```ts
63+
loginForm = form(this.loginModel);
64+
```
65+
66+
The `form()` function creates a form from your model, giving you access to field state and validation.
67+
</docs-step>
68+
69+
</docs-workflow>
70+
71+
Excellent! You've set up your form model. The `loginModel` signal holds your form data, and the `loginForm` provides access to each field with type safety.
72+
73+
Next, you'll learn [how to connect your form to the template](/tutorials/signal-forms/2-connect-form-template)!
Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
# Set up the form model
1+
# フォームモデルを設定
22

3-
Every Signal Form starts with a form data model - a signal that defines the shape of your data, and stores your form data.
3+
すべてのシグナルフォームは、データの形状を定義し、フォームデータを格納するシグナルであるフォームデータモデルから始まります。
44

5-
In this lesson, you'll learn how to:
5+
このレッスンでは、次の方法を学びます:
66

7-
- Define a TypeScript interface for your form data
8-
- Create a signal to hold form values
9-
- Use the `form()` function to create a Signal Form
7+
- フォームデータのTypeScriptインターフェースを定義
8+
- フォーム値を保持するシグナルを作成
9+
- `form()` 関数を使用してシグナルフォームを作成
1010

11-
Let's build the foundation for our login form!
11+
ログインフォームの基礎を構築しましょう!
1212

1313
<hr />
1414

1515
<docs-workflow>
1616

17-
<docs-step title="Define the LoginData interface">
18-
Create a TypeScript interface that defines the structure of your login form data. The form will have:
17+
<docs-step title="LoginDataインターフェースを定義">
18+
ログインフォームデータの構造を定義するTypeScriptインターフェースを作成します。フォームには次のものが含まれます:
1919

20-
- An `email` field (string)
21-
- A `password` field (string)
22-
- A `rememberMe` field (boolean)
20+
- `email` フィールド(文字列)
21+
- `password` フィールド(文字列)
22+
- `rememberMe` フィールド(真偽値)
2323

2424
```ts
2525
interface LoginData {
@@ -29,11 +29,11 @@ interface LoginData {
2929
}
3030
```
3131

32-
Add this interface above the `@Component` decorator.
32+
このインターフェースを `@Component` デコレーターの上に追加します。
3333
</docs-step>
3434

35-
<docs-step title="Import signal and form">
36-
Import the `signal` function from `@angular/core` and the `form` function from `@angular/forms/signals`:
35+
<docs-step title="signalとformをインポート">
36+
`@angular/core` から `signal` 関数を、`@angular/forms/signals` から `form` 関数をインポートします:
3737

3838
```ts
3939
import { Component, signal } from '@angular/core';
@@ -42,8 +42,8 @@ import { form } from '@angular/forms/signals';
4242

4343
</docs-step>
4444

45-
<docs-step title="Create the form model signal">
46-
In your component class, create a `loginModel` signal with initial values. Use the `LoginData` interface as the type parameter:
45+
<docs-step title="フォームモデルシグナルを作成">
46+
コンポーネントクラスで、初期値を持つ `loginModel` シグナルを作成します。型パラメータとして `LoginData` インターフェースを使用します:
4747

4848
```ts
4949
loginModel = signal<LoginData>({
@@ -53,21 +53,21 @@ loginModel = signal<LoginData>({
5353
});
5454
```
5555

56-
The initial values start as empty strings for text fields and `false` for the checkbox.
56+
初期値は、テキストフィールドには空文字列、チェックボックスには `false` として開始します。
5757
</docs-step>
5858

59-
<docs-step title="Create the form">
60-
Now create the form by passing your model signal to the `form()` function:
59+
<docs-step title="フォームを作成">
60+
モデルシグナルを `form()` 関数に渡してフォームを作成します:
6161

6262
```ts
6363
loginForm = form(this.loginModel);
6464
```
6565

66-
The `form()` function creates a form from your model, giving you access to field state and validation.
66+
`form()` 関数は、モデルからフォームを作成し、フィールドの状態とバリデーションへのアクセスを提供します。
6767
</docs-step>
6868

6969
</docs-workflow>
7070

71-
Excellent! You've set up your form model. The `loginModel` signal holds your form data, and the `loginForm` provides access to each field with type safety.
71+
素晴らしい! フォームモデルを設定しました。`loginModel` シグナルがフォームデータを保持し、`loginForm` が型安全性を備えた各フィールドへのアクセスを提供します。
7272

73-
Next, you'll learn [how to connect your form to the template](/tutorials/signal-forms/2-connect-form-template)!
73+
次に、[フォームをテンプレートに接続する方法](/tutorials/signal-forms/2-connect-form-template)を学びます!
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"openFiles": ["src/app/app.ts", "src/app/app.html"],
3+
"type": "editor",
4+
"title": "Set up the form model"
5+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"openFiles": ["src/app/app.ts", "src/app/app.html"],
33
"type": "editor",
4-
"title": "Set up the form model"
4+
"title": "フォームモデルを設定"
55
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Connect your form to the template
2+
3+
Now, you need to connect your form to the template using the `[field]` directive. This creates two-way data binding between your form model and the input elements.
4+
5+
In this lesson, you'll learn how to:
6+
7+
- Import the `Field` directive
8+
- Use the `[field]` directive to bind form fields to inputs
9+
- Connect text inputs and checkboxes to your form
10+
- Display form field values in the template
11+
12+
Let's wire up the template!
13+
14+
<hr />
15+
16+
<docs-workflow>
17+
18+
<docs-step title="Import the Field directive">
19+
Import the `Field` directive from `@angular/forms/signals` and add it to your component's imports array:
20+
21+
```ts
22+
import { form, Field } from '@angular/forms/signals';
23+
24+
@Component({
25+
selector: 'app-root',
26+
templateUrl: './app.html',
27+
styleUrl: './app.css',
28+
imports: [Field],
29+
changeDetection: ChangeDetectionStrategy.OnPush,
30+
})
31+
```
32+
33+
</docs-step>
34+
35+
<docs-step title="Bind the email field">
36+
In your template, add the `[field]` directive to the email input:
37+
38+
```html
39+
<input type="email" [field]="loginForm.email" />
40+
```
41+
42+
The `loginForm.email` expression accesses the email field from your form.
43+
</docs-step>
44+
45+
<docs-step title="Bind the password field">
46+
Add the `[field]` directive to the password input:
47+
48+
```html
49+
<input type="password" [field]="loginForm.password" />
50+
```
51+
52+
</docs-step>
53+
54+
<docs-step title="Bind the checkbox field">
55+
Add the `[field]` directive to the checkbox input:
56+
57+
```html
58+
<input type="checkbox" [field]="loginForm.rememberMe" />
59+
```
60+
61+
</docs-step>
62+
63+
<docs-step title="Display the form values">
64+
Below the form, there's a debug section to show current form values. Display each field value using `.value()`:
65+
66+
```html
67+
<p>Email: {{ loginForm.email().value() }}</p>
68+
<p>Password: {{ loginForm.password().value() ? '••••••••' : '(empty)' }}</p>
69+
<p>Remember me: {{ loginForm.rememberMe().value() ? 'Yes' : 'No' }}</p>
70+
```
71+
72+
Form field values are signals, so the displayed values update automatically as you type.
73+
</docs-step>
74+
75+
</docs-workflow>
76+
77+
Great work! You've connected your form to the template and displayed the form values. The `[field]` directive handles two-way data binding automatically - as you type, the `loginModel` signal updates, and the displayed values update immediately.
78+
79+
Next, you'll learn [how to add validation to your form](/tutorials/signal-forms/3-add-validation)!

0 commit comments

Comments
 (0)