Angular Notes: Inshort How DI is achieved in AngularJs ?

createInjector is called when application is bootstrapped in this method all the modules are loaded and resolved, so when we call services on modules using any of the service types provider, factory, service, constant and value they are registered using $injector. Once the bootstrap process is completed we can directly inject services where $injector will take care of creating and sending it to us. As an end user there is no need to worry how they are created and sent to you. Isn’t it cool !!!.

Refer angular.js for more information on createInjector, this is my understanding of DI in AngularJs please correct me if I’m wrong. Hope this post helps !!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s