Injecting Services, Factories, and Providers
As mentioned above all AngularJS services, factories, and providers should be created as AngularJS modules, and then associated to the gadget module. Each gadget is by default created as an AngularJS module, and the dependencies should be set to allow the services to be injected in the controller. To inject any custom object use the $inject.
<CONTROLLER_FUNCTION>.$inject = [ '$scope', 'RestServiceProvider','EventBus',
'$log','config'...];