Using Dependency Injection - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
Using Dependency Injection

Using Dependency Injection

Using Dependency Injection 

Dependency Injection is pervasive throughout AngularJS. You can use it when defining components or when providing run and config blocks for a module.
  • Servicesdirectivesfilters, and animations are defined by an injectable factory method or constructor function, and can be injected with "services", "values", and "constants" as dependencies.
  • Controllers are defined by a constructor function, which can be injected with any of the "service" and "value" as dependencies, but they can also be provided with "special dependencies". See Controllersbelow for a list of these special dependencies.
  • The run method accepts a function, which can be injected with "services", "values" and, "constants" as dependencies. Note that you cannot inject "providers" into run blocks.
  • The config method accepts a function, which can be injected with "providers" and "constants" as dependencies. Note that you cannot inject "services" or "values" into configuration.
  • The provider method can only be injected with other "providers". However, only those that have been registered beforehand can be injected. This is different from services, where the order of registration does not matter.

About Mariano

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.