According to the Angular documentation, we can only enter providers (and not instances) into the configuration blocks. https://docs.angularjs.org/guide/module#module-loading-dependencies
But contrary to this, Angular allows you to enter $provide or $inject , despite the fact that they are instances of a single-user service.
$provide
$inject
https://docs.angularjs.org/api/auto/service/$provide
I found this curious, so I did some research. Here is what I found:
In code, reason 2 is that $provide is placed in providerCache before providerInjector (the injector used in configuration blocks) is created. This ensures that he will always be a renowned provider for providerInjector . https://github.com/angular/angular.js/blob/master/src/auto/injector.js#L671
providerCache
providerInjector
However, I agree that the ability to enter $provide in configuration blocks seems to contradict the general rule regarding what can be entered in the configuration blocks specified here: https://docs.angularjs.org/guide/module#module- loading-dependencies
Despite the fact that what you can do here is clearly demonstrated: https://docs.angularjs.org/guide/module#configuration-blocks
$provide may be the only exception to the general rule.
Source: https://habr.com/ru/post/1268721/More articles:Cygwin: import color scheme from "Designer Color Scheme Designer" - cygwinHow to upload group chat history to Telegram? - pythonHow can I detect a user recording an iOS application using the ReplayKit screen recording APIs? - iosAccount Set: Set the default language for the iOS app - iosDoes calling `gc ()` manually make all finalizers execute immediately? - garbage-collectionCan I use third-party java libraries (.jar) to develop Android with Kotlin? - androidmacOS App: handling global keyboard shortcuts - cocoahttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1268724/firebase-no-properties-to-serialize-found-with-object-in-release-mode&usg=ALkJrhhjvkKw0xhNMIUkiNQA0tQWjTSPyAFix rdd filter by element class - scalaHow to import CSS files into webpack? - javascriptAll Articles