私はAngularを初めて使用しています。私はconfigブロックを勉強しており、モジュールのブロックを実行しています。プロバイダとインスタンスの違いは何ですか?
コードの下を見ていてください:あなたはそれが書かれているconfigブロックで見ることができるように
angular.module('myModule', []).
config(function(injectables) { // provider-injector
// This is an example of config block.
// You can have as many of these as you want.
// You can only inject Providers (not instances)
// into config blocks.
}).
run(function(injectables) { // instance-injector
// This is an example of a run block.
// You can have as many of these as you want.
// You can only inject instances (not Providers)
// into run blocks
});
を:「あなただけのプロバイダ(いないインスタンス)を注入することができます」。
これはどういう意味ですか?誰もプロバイダとインスタンスの違いを教えてください。
ありがとうございました。私の理解を助けました。 – RajSharma
ようこそ。 –