Issue
For example, we have one field Input, property 'currentNode' in child component and property 'activeElement' in parent component. Every time we change value in Input, it affects property 'currentNode'. And also, of course, parent component contains child component (I mean HTML).
So, I want that every time currentNode changes somehow, it affected activeElement, which's located in parent component.
Solution
Add (change)="" method into your Input field. Then Use @Output() to send the event on every change. While you emit currentNode in your parent. your parent function automatically calls then you can update your parent activeElement with the emitting value
click here to see How you can send data to your parent component
Answered By - shubham sharma
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.