I am currently in need of a system that functions like a "shopping cart" for one component within my site. It will essentially be a list of user-generated needs collected while they browse. Although this system won't involve pricing or tax calculations, each type of need will have its own unique sub-parameters that I am currently developing interfaces for. I anticipate the needs component to utilize 'any' types to receive incoming data.
At present, the process of creating extensive chains of @Inputs and @Outputs throughout the entire structure simply to navigate through one branch and descend down a level seems overly cumbersome. Instead, I am considering the possibility of implementing a function that directly feeds into the needs component, or possibly creating a class to aggregate all data and subscribing to it within the needs component.
In my search set to February 1st - now, I came across the following resource: Share data between components using a service in Angular2. While this sheds some light on the matter by illustrating its feasibility, I am still unsure about how to proceed.
As I haven't formulated any specific code attempts due to uncertainty regarding the approach, I only possess the components themselves. Given that my query pertains to establishing a relationship that is not dependent on the component's position in the tree hierarchy, sharing components displaying only <h1>hi</h1>
doesn't seem particularly useful at this stage. However, if you would like me to provide my code nevertheless, I can do so--although the content is minimal. Currently, I am utilizing Angular2 and am unable to upgrade Node and NPM to version 4. I would greatly appreciate any guidance on achieving this task.