2026-02-11 16:44:34 +00:00
|
|
|
---
|
|
|
|
|
trigger: always_on
|
|
|
|
|
---
|
|
|
|
|
|
2026-01-29 19:16:52 +00:00
|
|
|
This is the source code for the Angular framework. This guide outlines standard practices for AI agents working in this repository.
|
|
|
|
|
|
|
|
|
|
## Environment
|
|
|
|
|
|
|
|
|
|
- Use `pnpm` for package management.
|
2026-02-11 16:44:34 +00:00
|
|
|
- Use `pnpm bazel test //target` to run tests.
|
2026-01-29 19:16:52 +00:00
|
|
|
|
|
|
|
|
## Key Documentation
|
|
|
|
|
|
|
|
|
|
- [Building and Testing](contributing-docs/building-and-testing-angular.md): definitive guide for running targets.
|
|
|
|
|
- [Coding Standards](contributing-docs/coding-standards.md): style guide for TypeScript and other files.
|
|
|
|
|
- [Commit Guidelines](contributing-docs/commit-message-guidelines.md): format for commit messages and PR titles.
|
2026-01-29 19:18:58 +00:00
|
|
|
|
2026-02-17 16:23:59 +00:00
|
|
|
## Testing
|
|
|
|
|
|
|
|
|
|
- **Zoneless & Async-First:** Assume a zoneless environment where state changes schedule updates asynchronously.
|
|
|
|
|
- **Do NOT** use `fixture.detectChanges()` to manually trigger updates.
|
|
|
|
|
- **ALWAYS** use the "Act, Wait, Assert" pattern:
|
|
|
|
|
1. **Act:** Update state or perform an action.
|
|
|
|
|
2. **Wait:** `await fixture.whenStable()` to allow the framework to process the scheduled update.
|
|
|
|
|
3. **Assert:** Verify the output.
|
|
|
|
|
- To keep tests fast, minimize the need for waiting:
|
|
|
|
|
- Use `useAutoTick()` (from `packages/private/testing/src/utils.ts`) to fast-forward time via the mock clock.
|
|
|
|
|
- When waiting is necessary, use real async tests (`it('...', async () => { ... })`) along with:
|
|
|
|
|
- `await timeout(ms)` (from `packages/private/testing/src/utils.ts`) to wait a specific number of milliseconds.
|
|
|
|
|
- `await fixture.whenStable()` to wait for framework stability.
|
|
|
|
|
|
2026-01-29 19:18:58 +00:00
|
|
|
## Pull Requests
|
|
|
|
|
|
|
|
|
|
- Use the `gh` CLI (GitHub CLI) for creating and managing pull requests.
|