Files
everything-claude-code/docs/ja-JP/skills/angular-developer/references/navigate-to-routes.md
T
Claude 174e31b3fc feat(ja-JP): add skill sub-reference translations (angular, remotion, etc.)
Translated 85 skill sub-reference files to achieve full parity with
the English source:

- skills/angular-developer/references/ — 35 files (all references)
- skills/remotion-video-creation/rules/ — 28 files (all rules)
- skills/tinystruct-patterns/references/ — 5 files
- skills/openclaw-persona-forge/references/ — 6 files
- skills/skill-comply/prompts/ — 3 files
- skills/lead-intelligence/agents/ — 4 files
- skills/brand-voice/references/ — 1 file
- skills/frontend-slides/ — 2 files
- hooks/memory-persistence/README.md — 1 file

English source parity: 0 missing files (excluding rules/zh/, internal
docs, and experimental examples absent from zh-CN)
2026-05-18 06:15:26 +09:00

70 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ルートへのナビゲーション
Angular はルート間を遷移するための宣言的な方法とプログラム的な方法の両方を提供します。
## 宣言的なナビゲーション(`RouterLink`
アンカー要素に `RouterLink` ディレクティブを使用します。
```ts
import {RouterLink, RouterLinkActive} from '@angular/router';
@Component({
imports: [RouterLink, RouterLinkActive],
template: `
<nav>
<a routerLink="/dashboard" routerLinkActive="active-link">Dashboard</a>
<a [routerLink]="['/user', userId]">Profile</a>
</nav>
`,
})
export class Nav {
userId = '123';
}
```
- **絶対パス**`/` で始まります(例:`/settings`)。
- **相対パス**:先頭に `/` がありません。一つ上のレベルに移動するには `../` を使います。
## プログラム的なナビゲーション(`Router`)
`Router` サービスを注入して TypeScript コードからナビゲートします。
### `router.navigate()`
コマンドの配列を使用します。
```ts
private router = inject(Router);
private route = inject(ActivatedRoute);
// 標準的なナビゲーション
this.router.navigate(['/profile']);
// パラメーター付き
this.router.navigate(['/search'], {
queryParams: { q: 'angular' },
fragment: 'results'
});
// 相対ナビゲーション
this.router.navigate(['edit'], { relativeTo: this.route });
```
### `router.navigateByUrl()`
文字列パスを使用します。絶対ナビゲーションや完全な URL に最適です。
```ts
this.router.navigateByUrl('/products/123?view=details');
// 履歴の現在のエントリを置き換える
this.router.navigateByUrl('/login', {replaceUrl: true});
```
## URL パラメーター
- **ルートパラメーター**:パスの一部(例:`/user/123`)。
- **クエリパラメーター**`?` の後(例:`/search?q=query`)。
- **マトリックスパラメーター**:セグメントにスコープされる(例:`/products;category=books`)。