Declare a component output with `output<T>()` and emit values through its `.emit()` method. This replaces the decorator-based `@Output() EventEmitter<T>` pattern. ```ts import { ChangeDetectionStrategy, Component, input, output, } from '@angular/core'; interface SaveResult { id: string; } @Component({ selector: 'app-save-button', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: ` <button type="button" (click)="save()"> Save </button> `, }) export class...
Scanned 9/5/2026
Install to Claude Code
npx -y skills add HoangNguyen0403/agent-skills-standard --skill angular-components --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Angular Components?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-angular-components-c0b8b82b)More formats (shields.io, HTML) on the badges page.
# Using `output()` instead of `EventEmitter`
Declare a component output with `output<T>()` and emit values through its `.emit()` method. This replaces the decorator-based `@Output() EventEmitter<T>` pattern.
```ts
import {
ChangeDetectionStrategy,
Component,
input,
output,
} from '@angular/core';
interface SaveResult {
id: string;
}
@Component({
selector: 'app-save-button',
standalone: true,
imports: [],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<button type="button" (click)="save()">
Save
</button>
`,
})
export class SaveButtonComponent {
readonly id = input.required<string>();
readonly saved = output<SaveResult>();
save(): void {
this.saved.emit({ id: this.id() });
}
}
```
A parent listens to the output and receives the typed payload:
```html
<app-save-button [id]="documentId" (saved)="handleSaved($event)" />
```
Use `output<void>()` for an event with no payload. For two-way component state, use `model()` where appropriate. Outputs are for child-to-parent communication; the presentational child should not inject the service that persists the document.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!