oberconcejo/VS-CODE / .agents/skills/angular-developer
angular-developer
VerifiedGenerates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.
references/show-routes-with-outlets.md
View on GitHub# Show Routes with Outlets
The `RouterOutlet` directive is a placeholder where Angular renders the component for the current URL.
## Basic Usage
Include `<router-outlet />` in your template. Angular inserts the routed component as a sibling immediately following the outlet.
```html
<app-header /> <router-outlet />
<!-- Route content appears here -->
<app-footer />
```
## Nested Outlets
Child routes require their own `<router-outlet />` within the parent component's template.
```ts
// Parent component template
<h1>Settings</h1>
<router-outlet /> <!-- Child components like Profile or Security render here -->
```
## Named Outlets (Secondary Routes)
Pages can have multiple outlets. Assign a `name` to an outlet to target it specifically. The default name is `'primary'`.
```html
<router-outlet />
<!-- Primary -->
<router-outlet name="sidebar" />
<!-- Secondary -->
```
Define the `outlet` in the route config:
```ts
{
path: 'chat',
component: Chat,
outlet: 'sidebar'
}
```
## Outlet Lifecycle Events
`RouterOutlet` emits events when components are changed:
- `activate`: New component instantiated.
- `deactivate`: Component destroyed.
- `attach` / `detach`: Used with `RouteReuseStrategy`.
```html
<router-outlet (activate)="onActivate($event)" />
```
## Passing Data via `routerOutletData`
You can pass contextual data to the routed component using the `routerOutletData` input. The component accesses this via the `ROUTER_OUTLET_DATA` injection token as a signal.
```ts
// In Parent
<router-outlet [routerOutletData]="{ theme: 'dark' }" />
// In Routed Component
outletData = inject(ROUTER_OUTLET_DATA) as Signal<{ theme: string }>;
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |