config
functions. Thus you could not inject
$routeProvider
into PhoneListCtrl
".Hi Raptis,
Its a matter of wording. I’ll try to explain. You can create a provider. The normal use of an provider returns a factory, which you can inject into your code. However, angular allows you to create providers that may have configuration options. If you need to configure this options, you can inject the provider itself into the config functions.
as an example angular.module(test,[]).provider('sample', fucntion (){..})
returns actually 2 things.(hmmm, well for the sake of this argument it does!)
first it returns a factory named sample
, but also it returns a provider called sampleProvider
, the last one, you can only use inside the aforementioned config functions, and you can't use it anywhere else.
Does that clear it up enough for you?
Regards
Sander