Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • AngularJS Dependency Injection

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 201
    Comment on it

    Dependency Injection (DI):- It is a software design pattern and its main motive is to see how components get its dependencies


    Injector subsystem in AngularJS is liable for creating components, dependencies resolving and also providing other components as requested.


    Using Dependency Injection DI is common throughout AngularJS. You can use it when defining a component or when providing a module run and config blocks.


    Components such as services, directives, filters, and animations are defined by an injectable factory method or constructor function. These components can be injected with "service" and "value" components as dependencies.


    Controllers are defined by a constructor function, which can be injected with any of the "service" and "value" components as dependencies, but they can also be provided with special dependencies.


    The run method accepts a function, which can be injected with "service", "value" and "constant" components as dependencies. Note that you cannot inject "providers" into run blocks.


    The config method accepts a function, which can be injected with "provider" and "constant" components as dependencies. Note that you cannot inject "service" or "value" components into configuration.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: