$provide outside config blocks
问题 I'm certainly missing some fundamental point about the injector, but I fail to understand why exactly this angular.module('app').config(function ($provide) { ... }); and this angular.module('app').config(function ($injector) { $injector.invoke(function ($provide) { ... }); }); work as intended, while this app.run(function($provide) { ... }); will throw Error: [$injector:unpr] Unknown provider: $provideProvider <- $provide As follows from the above, config has some special relationship with