Hi,
I am working with AngularJS 1.x and I can define the same service multiple 
times in the same module. Please see this Plunker example. 
<https://plnkr.co/edit/5cwg09FcwQyaEd4LJyb5>


In the example, I am defining the service "nameService" 2 times in module "
myApp". At runtime, AngularJS uses the value returned by the second 
implementation of the service: "Second Definition".

So, empirically, AngularJS seems to use always the latest definition of a 
service, ignoring the previous ones.

*My question is: is there any official documentation describing this 
behavior?*

I mean, Angular could decide to use always the first definition and discard 
the others but it decides to use always the latest.  I this behavior 
documented somewhere in the official AngularJS documentation?

Thank you, regards
Andrea

-- 
You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to