I wanted to split my component into sub-components.
I have passed a Array
<object> to a child using the @Input decorator.
But as soon as the data enters the child, it takes the form of a string looking like this “[Object] [Object] …”.
It seems to me that because the input takes the form of an attribute in the template, the value must be changed to a string since this is what the attribute value required in the HTML format.
I was suprized. I thought the data management was virtual and not directly mapped to HTML attributes for every Input.
What method do you recommend to pass data to a child? There may be another way than an @Input. Any structure storing globally the data would suite. Maybe dependency injection with a Redux state thing would work.
Maybe Observables would allow to subscribe and pass the event to the child. No idea how it would work though.