'How to fire parent function on change when something happens in child without touching the child component
So I have this child component which I wish I don't want to disturb, this component has a <ng-select> in it. I want the the parent component to detect if there is any changes made to this child component. So it looks like this now:
Parent-component.html
<div>
<child-component></child-component>
</div>
I have a function in the ts file if there is a change happening like this:
Parent-component.ts
changeFunction() {
***something happens***
}
I initially just tried adding a (change)=changeFunction() to the child component, making it like this:
<div>
<child-component (change)=changeFunction()></child-component>
</div>
but that doesn't seem to work.
Is there anything I could do to detect when a change is made in the child component without having to do anything on the child component itself?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
