|
2 | 2 | ルーティングは、シングルページアプリケーションでユーザーが閲覧する内容を変更するのに役立ちます。
|
3 | 3 | </docs-decorative-header>
|
4 | 4 |
|
5 |
| -Angular Router (`@angular/router`) is the official library for managing navigation in Angular applications and a core part of the framework. It is included by default in all projects created by Angular CLI. |
| 5 | +Angular Router (`@angular/router`) は、Angularアプリケーションでナビゲーションを管理するための公式ライブラリであり、フレームワークの核となる部分です。Angular CLIによって作成されたすべてのプロジェクトにデフォルトで含まれています。 |
6 | 6 |
|
7 |
| -## Installation |
| 7 | +## インストール {#installation} |
8 | 8 |
|
9 |
| -Angular Router is included by default in all Angular projects setup with the Angular CLI `ng new` command. |
| 9 | +Angular Routerは、Angular CLIの`ng new`コマンドによりセットアップされたすべてのAngularプロジェクトにデフォルトで含まれています。 |
10 | 10 |
|
11 |
| -### Prerequisite |
| 11 | +### 前提条件 {#prerequisite} |
12 | 12 |
|
13 | 13 | - Angular CLI
|
14 | 14 |
|
15 |
| -### Add to an existing project |
| 15 | +### 既存のプロジェクトに追加 {#add-to-an-existing-project} |
16 | 16 |
|
17 |
| -If your project does not include Angular Router, you can install it manually with the following command: |
| 17 | +プロジェクトにAngular Routerが含まれていない場合、以下のコマンドで手動インストールできます: |
18 | 18 |
|
19 | 19 | ```bash
|
20 | 20 | ng add @angular/router
|
21 | 21 | ```
|
22 | 22 |
|
23 |
| -The Angular CLI will then install all the necessary dependencies. |
| 23 | +Angular CLIが、必要なすべての依存関係をインストールします。 |
24 | 24 |
|
25 |
| -## Why is routing necessary in a SPA? |
| 25 | +## SPAでルーティングが必要な理由 {#why-is-routing-necessary-in-a-spa} |
26 | 26 |
|
27 |
| -When you navigate to a URL in your web browser, the browser normally makes a network request to a web server and displays the returned HTML page. When you navigate to a different URL, such as clicking a link, the browser makes another network request and replaces the entire page with a new one. |
| 27 | +WebブラウザでURLに移動すると、ブラウザは通常、Webサーバーにネットワークリクエストを行い、返されたHTMLページを表示します。リンクをクリックするなどの別のURLに移動すると、ブラウザは別のネットワークリクエストを行い、ページ全体を新しいものに置き換えます。 |
28 | 28 |
|
29 |
| -A single-page application (SPA) differs in that the browser only makes a request to a web server for the first page, the `index.html`. After that, a client-side router takes over, controlling which content displays based on the URL. When a user navigates to a different URL, the router updates the page's content in place without triggering a full-page reload. |
| 29 | +シングルページアプリケーション(SPA)は、ブラウザが最初のページである`index.html`に対してのみWebサーバーにリクエストを行う点で異なります。その後、クライアントサイドルーターが引き継ぎ、URLに基づいて表示するコンテンツを制御します。ユーザーが別のURLに移動すると、ルーターはページ全体のリロードをトリガーすることなく、その場でページコンテンツを更新します。 |
30 | 30 |
|
31 |
| -## How Angular manages routing |
| 31 | +## Angularがルーティングを管理する方法 {#how-angular-manages-routing} |
32 | 32 |
|
33 |
| -Routing in Angular is comprised of three primary parts: |
| 33 | +Angularにおけるルーティングは、主に3つの要素で構成されています。 |
34 | 34 |
|
35 |
| -1. **Routes** define which component displays when a user visits a specific URL. |
36 |
| -2. **Outlets** are placeholders in your templates that dynamically load and render components based on the active route. |
37 |
| -3. **Links** provide a way for users to navigate between different routes in your application without triggering a full page reload. |
| 35 | +1. **ルート**は、ユーザーが特定のURLにアクセスしたときにどのコンポーネントを表示するかを定義します。 |
| 36 | +2. **アウトレット**は、アクティブなルートに基づいてコンポーネントを動的にロードおよびレンダリングする、テンプレート内のプレースホルダーです。 |
| 37 | +3. **リンク**は、フルページリロードをトリガーすることなく、アプリケーション内の異なるルート間をユーザーが移動するための手段を提供します。 |
38 | 38 |
|
39 |
| -In addition, the Angular Routing library offers additional functionality such as: |
| 39 | +さらに、Angularルーティングライブラリは、次のような追加機能を提供します。 |
40 | 40 |
|
41 |
| -- Nested routes |
42 |
| -- Programmatic navigation |
43 |
| -- Route params, queries and wildcards |
44 |
| -- Activated route information with `ActivatedRoute` |
45 |
| -- View transition effects |
46 |
| -- Navigation guards |
| 41 | +- ネストされたルート |
| 42 | +- プログラムによるナビゲーション |
| 43 | +- ルートパラメーター、クエリ、ワイルドカード |
| 44 | +- `ActivatedRoute`によるアクティブ化されたルート情報 |
| 45 | +- ビュートランジション効果 |
| 46 | +- ナビゲーションガード |
47 | 47 |
|
48 |
| -## Next steps |
| 48 | +## 次のステップ {#next-steps} |
49 | 49 |
|
50 |
| -Learn about how you can [define routes using Angular router](/guide/routing/define-routes). |
| 50 | +[Angularルーターを使用してルートを定義する](/guide/routing/define-routes)方法について学びましょう。 |
0 commit comments