What is @Input() in angular?
12
17-Dec-2025
Updated on 17-Dec-2025
Anubhav Kumar
17-Dec-2025What is
@Input()?@Input()is an Angular decorator that allows a parent component to pass data to a child component.Think of it like:
Simple Meaning
Means:
Basic Example
Parent Component (Sender)
Child Component (Receiver)
Output
Why
@Input()is NeededWithout
@Input():Angular blocks external binding for safety.
@Input()explicitly allows it.How Data Flows
One-way data flow (parent → child).
Chat App Example (Realistic)
Parent (Chat Window)
Child (Chat Bubble)
@Input()with AliasUsage:
Useful when:
@Input()with Setter (Advanced)Used for validation or transformation.
Lifecycle &
@Input()Important lifecycle hooks:
Runs when:
@Input()vs@Output()Key Takeaway