How do I access the service provider when registering using typescript class How do I access the service provider when registering using typescript class angularjs angularjs

How do I access the service provider when registering using typescript class


Problem is with your registration of provider. Instead of

  angular.module('apiService').provider('apiService.baseService', BaseServiceProvider);

do:

 angular.module('apiService').provider('BaseService', BaseServiceProvider);

and access in the config phase like you do, BaseServiceProvider (postfix word Provider). When injecting the provider instance anywhere else you could just use BaseService. So basically you don't inject with the class name, instead you inject with the name it is registered with.