Suggest an editImprove this articleRefine the answer for “What does ngOnChanges() do? When is it called?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)In Angular, `ngOnChanges()` is a lifecycle hook that **is called when a component's input properties (**`@Input`**) change**. **Key point:** `ngOnChanges` is a way to track and handle changes to a component's input data.Shown above the full answer for quick recall.Answer (EN)ImageIn Angular, `ngOnChanges()` is a lifecycle hook that **is called when a component's input properties (**`@Input`**) change**. ## Key points 1. **What it does**: - Lets you react to changes in data passed from the parent component. - Receives a `changes: SimpleChanges` object, where you can see the old and new value of each changed property. 2. **When it is called**: - **Before** `ngOnInit()` - the first time input property values are passed. - **Every time** the `@Input` values change after the component is initialized. Example: ```ts export class ChildComponent implements OnChanges { @Input() name: string; ngOnChanges(changes: SimpleChanges) { console.log('Input data changed:', changes); } } ``` - If `name` changes in the parent, Angular will call `ngOnChanges` and show the old and new value. In other words, `ngOnChanges` **is a way to track and handle changes to a component's input data**.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.