0

I'm wondering if it possible to include a .config section just once and that it affects all modules. Question is related with caching requests in IE, and since I don't want to do this in every module that is making requests, I was wondering if it possible to include a .config section globally...

I've googled quite a lot, look in the Angular tutorial, looked at the NG-book and found nothing on this regard...any idea?

Thanks!

EDIT: Just added this as a config in the module included in all controllers and it works

Community
  • 1
  • 1
AlejandroVK
  • 7,123
  • 13
  • 49
  • 73

1 Answers1

1

During bootstrap all modules are combined into one application and a single injector is created for it. Services in Angular are singletons in the sense that they are only created once per injector.

This means that there is only once $http service created and its configuration will be global for the entire application.

tasseKATT
  • 38,330
  • 8
  • 83
  • 65