Reputation: 2846
I have a data binding from parent to child component and the childs template renders the data.
How can I act, in the child, on the event of the data being changed so I can do stuff with it before I render it?
Upvotes: 1
Views: 723
Reputation: 7068
Instead of using
@Input() myInputVariable;
You can intercept the input property changes with a setter, you can read more here
@Input() set myInputVariable(value: boolean) { // Do Something here }
Upvotes: 3