Child component:
export class Child {
@Input() public value: string;
public childFunction(){...}
}
Parent component:
You can use the ngOnChanges()
lifecycle hook
export class Child {
@Input() public value: string;
ngOnChanges(changes) {
this.childFunction()
}
public childFunction(){...}
}
or use a setter
export class Child {
@Input()
public set value(val: string) {
this._value = val;
this.childFunction();
}
public childFunction(){...}
}