Overview
Angular provides two primary mechanisms for component communication: inputs for passing data from parent to child, and outputs for emitting events from child to parent.@Input Decorator
Signature
Parameters
string | Input
Either an alias string or a configuration object.
Input Options
string
Alternative name for the input in templates.
boolean
Whether the input must be provided. Causes compile error if missing.
(value: any) => any
Function to transform the input value before assignment.
Basic Input Example
user-card.component.ts
Input with Alias
product.component.ts
Required Inputs
profile.component.ts
Input Transforms
toggle.component.ts
input() Function (Signal-Based)
Signature
Signal Input Example
counter.component.ts
Required Signal Input
item-detail.component.ts
Signal Input with Transform
date-display.component.ts
@Output Decorator
Signature
Parameters
string
Alternative name for the output in templates.
Basic Output Example
button.component.ts
Output with Data
search.component.ts
Output with Alias
dropdown.component.ts
output() Function (Signal-Based)
Signature
Signal Output Example
modern-button.component.ts
Output with Custom Event Type
item-list.component.ts
Two-Way Binding
NgModel Pattern
custom-input.component.ts
Signal-Based Two-Way Binding
signal-input.component.ts
Parent-Child Communication Example
parent.component.ts
child.component.ts
Best Practices
Comparison: Decorator vs Function
Related APIs
- @Component - Define components
- EventEmitter - Emit custom events
- model() - Two-way binding with signals
- computed() - Derived signal values
See Also
Component Inputs
Learn about input properties
Component Outputs
Master output events
Signals
Understand signal reactivity
Two-Way Binding
Implement two-way binding
