There seems to be a few ways of skinning this cat, but I want to know the best (practice) and why.
If I want to collect some data in child-cmp and pass it to parent-cmp, I can:
- Wrap an object with a function from parent and pass it as an input to child, calling the function on the input.
- Make an EventEmitter function in child-cmp and emit the result, collecting the data in parent-cmp.
- Access the child through @ViewChild() and directly call it's methods.
- Create an ngModel (only if in a form?) with the data to be collected
I'm sure there's more. I feel like using the Event emitter is the most Angulary thing to do, for a non form based component. But I can't really explain why with a good technical foundation. Thoughts?