I have a session service that I use around all over my routes and components. I’m now under the dilemma of whether I should inject them in every component that needs them or should I just pass them around like attributes to follow the data down practice.
Question now is:
- What’s more expensive in terms of performance, injecting a service or passing only the necessary attributes that you need?
- When a service is already declared in a parent component and you also need some of its attributes in the child component, do you inject it in the child component or do you simply pass the necessary attributes?
I’m more inclined to pass the services attributes rather than injecting them to components but I’d like to hear other people’s thoughts.