Reputation: 40
In AngularJS, does the order of my dependencies matter?.
Example:
Suppose I have an 'awesomeGlobalService'
to handle a set of services common to all the modules of my app.
Should I inject it first?:
angular.module('myModule', ['awesomeGlobalService', 'secondModule', 'anotherModule', ...])
or should I inject it last?:
angular.module('myModule', ['secondModule', 'anotherModule', ... 'awesomeGlobalService'])
or it really doesn't matter as long is in the injection array?
Upvotes: 1
Views: 677
Reputation: 513
Below picture depicts the flow of life cycle when injecting dependencies:
Upvotes: 1