Reputation: 5008
I'm learning Angular. I want to see how a Child component Output
data to Parent component. I've gone through some articles and documentation then created a minimal program. I'm able to send data from Parent to Child successfully but not the vice-versa. I'm not getting any error but I'm not getting the values also. Can you please see my code and correct me. Here is my stackblitz.
Upvotes: 0
Views: 113
Reputation: 2165
working demo : demo
You have missed to place {{ChildCurrentVal}}
in app.component.html
and not only that your child component will return value only when your child receive value from parent otherwise it return undefined
.
Upvotes: 1
Reputation: 21658
It is working, you just don't show the value of ChildCurrentVal anywhere.
Put
{{ChildCurrentVal}}
In the template somewhere
Upvotes: 3