If I want to create a custom provider and configure it within Module.config, Angular appears to require the provider be declared first.
This does not work:
module.config(function(myServiceProvider) { });
module.provider('myService', function() { });
This does work:
module.provider('myService', function() { });
module.config(function(myServiceProvider) { });
Only the order is different.
I've tried this with Module.run as well, and it seems to have the same limitation. Is there any way around this other than ensuring the config code is loaded after the provider code?
Edit: Here's a JSFiddle of the working order, and a JSFiddle of the NON-working order. Note the only thing that changes is the order!