Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

aymene chaabaoui
aymene chaabaoui
901 Points

dependency injection - angular 4 vs spring

hello guys I want to know about dependency injection in angular 4 and spring boot (spring in general ), so I gonna start with what I know : in angular 4 we inject the dependency by setting the service ( or something else ) in the constructor's arguments of component, and despite we inject many times from many components the same service, the value of the variable in this service still the same (I mean the value still intact) for example : if we have service S with variable VARS, and tow component C1 and C2, and we inject the dependencie to S by C1, then we change the value (hello for example ) of VARS from C1, here if we have access to S from C2,we gonna find the 'hello' value, so is the same value, my question is: how the dependency injection work in spring, I don't want a theoretical lesson, what I want is practical case study (is the value change like angular or not ) thank you in advance.