1import { Component, Input, OnChanges } from "@angular/core";
2
3@Component({
4 selector: "child-component",
5 templateUrl: "./child-component.html"
6})
7export class MyComponent implements OnChanges {
8 @Input() someInput: string;
9
10 constructor() {}
11
12 ngOnChanges() {
13 /**********THIS FUNCTION WILL TRIGGER WHEN PARENT COMPONENT UPDATES 'someInput'**************/
14 //Write your code here
15 console.log(this.someInput);
16 }
17
18}
19