Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h2 class="docs-title">On this page</h2>
<li class="docs-faceted-list-item" [class.docs-toc-item-h2]="item.level === TableOfContentsLevel.H2"
[class.docs-toc-item-h3]="item.level === TableOfContentsLevel.H3">
<!-- Not using routerLink + fragment because of: https://github.com/angular/angular/issues/30139 -->
<a [href]="location.path() + '#' + item.id" [class.docs-faceted-list-item-active]="item.id === activeItemId()">
<a [href]="location.path() + '#' + item.id" [class.docs-faceted-list-item-active]="item.id === activeItemId()" [title]="item.title">
{{ item.title }}
</a>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h2 class="docs-title">目次</h2>
<li class="docs-faceted-list-item" [class.docs-toc-item-h2]="item.level === TableOfContentsLevel.H2"
[class.docs-toc-item-h3]="item.level === TableOfContentsLevel.H3">
<!-- Not using routerLink + fragment because of: https://github.com/angular/angular/issues/30139 -->
<a [href]="location.path() + '#' + item.id" [class.docs-faceted-list-item-active]="item.id === activeItemId()">
<a [href]="location.path() + '#' + item.id" [class.docs-faceted-list-item-active]="item.id === activeItemId()" [title]="item.title">
{{ item.title }}
</a>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ You can set the change detection strategy of a component to `OnPush` in the `@Co

```ts
import { ChangeDetectionStrategy, Component } from '@angular/core';

@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ OnPush変更検知は、Angularにコンポーネントのサブツリーの変

```ts
import { ChangeDetectionStrategy, Component } from '@angular/core';

@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
})
Expand Down
6 changes: 3 additions & 3 deletions adev-ja/src/content/best-practices/style-guide.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ When in doubt, go with the approach that leads to smaller files.

### Prefer the `inject` function over constructor parameter injection

Prefer using the `inject` function over injecting constructor parameters. The `inject` function works the same way as constructor parameter injection, but offers several style advantages:
Prefer using the [`inject`](/api/core/inject) function over injecting constructor parameters. The [`inject`](/api/core/inject) function works the same way as constructor parameter injection, but offers several style advantages:

- `inject` is generally more readable, especially when a class injects many dependencies.
- [`inject`](/api/core/inject) is generally more readable, especially when a class injects many dependencies.
- It's more syntactically straightforward to add comments to injected dependencies
- `inject` offers better type inference.
- [`inject`](/api/core/inject) offers better type inference.
- When targeting ES2022+ with [`useDefineForClassFields`](https://www.typescriptlang.org/tsconfig/#useDefineForClassFields), you can avoid separating field declaration and initialization when fields read on injected dependencies.

[You can refactor existing code to `inject` with an automatic tool](reference/migrations/inject-function).
Expand Down
6 changes: 3 additions & 3 deletions adev-ja/src/content/best-practices/style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ src/

### コンストラクターパラメーターインジェクションよりも`inject`関数を推奨 {#prefer-the-inject-function-over-constructor-parameter-injection}

コンストラクターパラメーターインジェクションよりも`inject`関数を使用することを推奨します。`inject`関数はコンストラクターパラメーターインジェクションと同じように機能しますが、いくつかのスタイルの利点があります。
コンストラクターパラメーターインジェクションよりも[`inject`](/api/core/inject)関数を使用することを推奨します。[`inject`](/api/core/inject)関数はコンストラクターパラメーターインジェクションと同じように機能しますが、いくつかのスタイルの利点があります。

- `inject`は、特にクラスが多くの依存性を注入する場合に、一般的に読みやすくなります。
- [`inject`](/api/core/inject)は、特にクラスが多くの依存性を注入する場合に、一般的に読みやすくなります。
- 注入された依存性へのコメント追加が、構文的に見てより簡単です。
- `inject`はより優れた型推論を提供します。
- [`inject`](/api/core/inject)はより優れた型推論を提供します。
- [`useDefineForClassFields`](https://www.typescriptlang.org/tsconfig/#useDefineForClassFields)を使用してES2022+をターゲットにする場合、注入された依存性でフィールドを読み取る際に、フィールド宣言と初期化を分離することを回避できます。

[既存のコードを自動ツールで`inject`にリファクタリングできます](reference/migrations/inject-function)
Expand Down
2 changes: 1 addition & 1 deletion adev-ja/src/content/guide/aria/combobox.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Use documented patterns instead when:
- Single-selection dropdowns are needed - See the [Select pattern](guide/aria/select) for complete dropdown implementation
- Multiple-selection dropdowns are needed - See the [Multiselect pattern](guide/aria/multiselect) for multi-select with compact display

Note: The [Autocomplete](guide/aria/autocomplete), [Select](guide/aria/select), and [Multiselect](guide/aria/multiselect) guides show documented patterns that combine this directive with [Listbox](guide/aria/listbox) for specific use cases.
NOTE: The [Autocomplete](guide/aria/autocomplete), [Select](guide/aria/select), and [Multiselect](guide/aria/multiselect) guides show documented patterns that combine this directive with [Listbox](guide/aria/listbox) for specific use cases.

## Features

Expand Down
2 changes: 1 addition & 1 deletion adev-ja/src/content/guide/aria/combobox.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
- 単一選択のドロップダウンが必要な場合 - 完全なドロップダウンの実装については、[Selectパターン](guide/aria/select)を参照してください
- 複数選択のドロップダウンが必要な場合 - コンパクトな表示の複数選択については、[Multiselectパターン](guide/aria/multiselect)を参照してください

Note: [Autocomplete](guide/aria/autocomplete)[Select](guide/aria/select)[Multiselect](guide/aria/multiselect)のガイドでは、このディレクティブを特定のユースケースのために[Listbox](guide/aria/listbox)と組み合わせた、ドキュメント化されたパターンが示されています。
NOTE: [Autocomplete](guide/aria/autocomplete)[Select](guide/aria/select)[Multiselect](guide/aria/multiselect)のガイドでは、このディレクティブを特定のユースケースのために[Listbox](guide/aria/listbox)と組み合わせた、ドキュメント化されたパターンが示されています。

## 機能 {#features}

Expand Down
8 changes: 4 additions & 4 deletions adev-ja/src/content/guide/aria/grid.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

A grid enables users to navigate two-dimensional data or interactive elements using directional arrow keys, Home, End, and Page Up/Down. Grids work for data tables, calendars, spreadsheets, and layout patterns that group related interactive elements.

<docs-code-multifile preview hideCode path="adev/src/content/examples/aria/grid/src/table/basic/app/app.ts">
<docs-code header="TS" path="adev/src/content/examples/aria/grid/src/table/basic/app/app.ts"/>
<docs-code header="HTML" path="adev/src/content/examples/aria/grid/src/table/basic/app/app.html"/>
<docs-code header="CSS" path="adev/src/content/examples/aria/grid/src/table/basic/app/app.css"/>
<docs-code-multifile preview hideCode path="adev/src/content/examples/aria/grid/src/overview/basic/app/app.ts">
<docs-code header="TS" path="adev/src/content/examples/aria/grid/src/overview/basic/app/app.ts"/>
<docs-code header="HTML" path="adev/src/content/examples/aria/grid/src/overview/basic/app/app.html"/>
<docs-code header="CSS" path="adev/src/content/examples/aria/grid/src/overview/basic/app/app.css"/>
</docs-code-multifile>

## Usage
Expand Down
8 changes: 4 additions & 4 deletions adev-ja/src/content/guide/aria/grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

グリッドを使用すると、ユーザーは方向矢印キー、Home、End、Page Up/Downを使用して2次元データやインタラクティブな要素をナビゲートできます。グリッドは、データテーブル、カレンダー、スプレッドシート、および関連するインタラクティブな要素をグループ化するレイアウトパターンで機能します。

<docs-code-multifile preview hideCode path="adev/src/content/examples/aria/grid/src/table/basic/app/app.ts">
<docs-code header="TS" path="adev/src/content/examples/aria/grid/src/table/basic/app/app.ts"/>
<docs-code header="HTML" path="adev/src/content/examples/aria/grid/src/table/basic/app/app.html"/>
<docs-code header="CSS" path="adev/src/content/examples/aria/grid/src/table/basic/app/app.css"/>
<docs-code-multifile preview hideCode path="adev/src/content/examples/aria/grid/src/overview/basic/app/app.ts">
<docs-code header="TS" path="adev/src/content/examples/aria/grid/src/overview/basic/app/app.ts"/>
<docs-code header="HTML" path="adev/src/content/examples/aria/grid/src/overview/basic/app/app.html"/>
<docs-code header="CSS" path="adev/src/content/examples/aria/grid/src/overview/basic/app/app.css"/>
</docs-code-multifile>

## 使用法 {#usage}
Expand Down
13 changes: 9 additions & 4 deletions adev-ja/src/content/guide/aria/listbox.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,19 @@ With `orientation="horizontal"`, left and right arrow keys navigate between opti

### Selection modes

Listbox supports two selection modes that control when items become selected. Choose the mode that matches your interface's interaction pattern.
Listbox supports two selection modes that control when items become selected.

<docs-code-multifile preview hideCode path="adev/src/content/examples/aria/listbox/src/modes/app/app.ts">
<!-- <docs-code-multifile preview hideCode path="adev/src/content/examples/aria/listbox/src/modes/app/app.ts">
<docs-code header="app.ts" path="adev/src/content/examples/aria/listbox/src/modes/app/app.ts" />
<docs-code header="app.html" path="adev/src/content/examples/aria/listbox/src/modes/app/app.html" />
</docs-code-multifile>
</docs-code-multifile> -->

| Mode | Description |
| ------------ | ------------------------------------------------------------------------------------------------------ |
| `'follow'` | Automatically selects the focused item, providing faster interaction when selection changes frequently |
| `'explicit'` | Requires Space or Enter to confirm selection, preventing accidental changes while navigating |

The `'follow'` mode automatically selects the focused item, providing faster interaction when selection changes frequently. The `'explicit'` mode requires Space or Enter to confirm selection, preventing accidental changes while navigating. Dropdown patterns typically use `'follow'` mode for single selection.
TIP: Dropdown patterns typically use `'follow'` mode for single selection.

## APIs

Expand Down
13 changes: 9 additions & 4 deletions adev-ja/src/content/guide/aria/listbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,19 @@ Angularのリストボックスは、以下の機能を備えた完全にアク

### 選択モード {#selection-modes}

リストボックスは、アイテムがいつ選択されるかを制御する2つの選択モードをサポートしています。インターフェースのインタラクションパターンに合ったモードを選択してください。
リストボックスは、アイテムがいつ選択されるかを制御する2つの選択モードをサポートしています。

<docs-code-multifile preview hideCode path="adev/src/content/examples/aria/listbox/src/modes/app/app.ts">
<!-- <docs-code-multifile preview hideCode path="adev/src/content/examples/aria/listbox/src/modes/app/app.ts">
<docs-code header="app.ts" path="adev/src/content/examples/aria/listbox/src/modes/app/app.ts" />
<docs-code header="app.html" path="adev/src/content/examples/aria/listbox/src/modes/app/app.html" />
</docs-code-multifile>
</docs-code-multifile> -->

| モード | 説明 |
| ------------ | -------------------------------------------------------------------------------------- |
| `'follow'` | フォーカスされたアイテムを自動的に選択し、選択が頻繁に変わる場合に、より速いインタラクションを提供します |
| `'explicit'` | 選択を確定するためにSpaceキーまたはEnterキーが必要で、ナビゲーション中の意図しない変更を防ぎます |

`'follow'`モードはフォーカスされたアイテムを自動的に選択し、選択が頻繁に変わる場合に、より速いインタラクションを提供します。`'explicit'`モードでは、選択を確定するためにSpaceキーまたはEnterキーが必要で、ナビゲーション中の意図しない変更を防ぎます。ドロップダウンパターンでは、通常、単一選択のために`'follow'`モードが使用されます。
TIP: ドロップダウンパターンでは、通常、単一選択のために`'follow'`モードが使用されます。

## API

Expand Down
2 changes: 1 addition & 1 deletion adev-ja/src/content/guide/aria/overview.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

## What is Angular Aria?

Building accessible components seems straightforward, but implementing them according to the W3 Accessibility Guidelines requires significant effort and accessibility expertise.
Building accessible components seems straightforward, but implementing them according to the W3C Accessibility Guidelines requires significant effort and accessibility expertise.

Angular Aria is a collection of headless, accessible directives that implement common WAI-ARIA patterns. The directives handle keyboard interactions, ARIA attributes, focus management, and screen reader support. All you have to do is provide the HTML structure, CSS styling, and business logic!

Expand Down
20 changes: 10 additions & 10 deletions adev-ja/src/content/guide/components/anatomy-of-components.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,41 @@ Every component must have:

You provide Angular-specific information for a component by adding a `@Component` [decorator](https://www.typescriptlang.org/docs/handbook/decorators.html) on top of the TypeScript class:

<docs-code language="angular-ts" highlight="[1, 2, 3, 4]">
```angular-ts {highlight: [1, 2, 3, 4]}
@Component({
selector: 'profile-photo',
template: `<img src="profile-photo.jpg" alt="Your profile photo">`,
})
export class ProfilePhoto { }
</docs-code>
```

For full details on writing Angular templates, including data binding, event handling, and control flow, see the [Templates guide](guide/templates).

The object passed to the `@Component` decorator is called the component's **metadata**. This includes the `selector`, `template`, and other properties described throughout this guide.

Components can optionally include a list of CSS styles that apply to that component's DOM:

<docs-code language="angular-ts" highlight="[4]">
```angular-ts {highlight: [4]}
@Component({
selector: 'profile-photo',
template: `<img src="profile-photo.jpg" alt="Your profile photo">`,
styles: `img { border-radius: 50%; }`,
})
export class ProfilePhoto { }
</docs-code>
```

By default, a component's styles only affect elements defined in that component's template. See [Styling Components](guide/components/styling) for details on Angular's approach to styling.

You can alternatively choose to write your template and styles in separate files:

<docs-code language="angular-ts" highlight="[3, 4]">
```ts {highlight: [3,4]}
@Component({
selector: 'profile-photo',
templateUrl: 'profile-photo.html',
styleUrl: 'profile-photo.css',
})
export class ProfilePhoto { }
</docs-code>
```

This can help separate the concerns of _presentation_ from _behavior_ in your project. You can choose one approach for your entire project, or you decide which to use for each component.

Expand Down Expand Up @@ -78,19 +78,19 @@ Important: In Angular versions before 19.0.0, the `standalone` option defaults t

Every component defines a [CSS selector](https://developer.mozilla.org/docs/Learn/CSS/Building_blocks/Selectors):

<docs-code language="angular-ts" highlight="[2]">
```angular-ts {highlight: [2]}
@Component({
selector: 'profile-photo',
...
})
export class ProfilePhoto { }
</docs-code>
```

See [Component Selectors](guide/components/selectors) for details about which types of selectors Angular supports and guidance on choosing a selector.

You show a component by creating a matching HTML element in the template of _other_ components:

<docs-code language="angular-ts" highlight="[8]">
```angular-ts {highlight: [8]}
@Component({
selector: 'profile-photo',
})
Expand All @@ -101,7 +101,7 @@ imports: [ProfilePhoto],
template: `<profile-photo />`
})
export class UserProfile { }
</docs-code>
```

Angular creates an instance of the component for every matching HTML element it encounters. The DOM element that matches a component's selector is referred to as that component's **host element**. The contents of a component's template are rendered inside its host element.

Expand Down
Loading