Activity Forums Salesforce® Discussions How to create dependency injection in component using by Angular?

  • Archit

    Member
    March 29, 2018 at 12:33 pm

    Dependency Injection is a powerful pattern for managing code dependencies. This cookbook explores many of the features of Dependency Injection (DI) in Angular.

    When Angular creates the AppComponent, the dependency injection framework creates an instance of the LoggerService and starts to create the UserContextService. The UserContextService needs the LoggerService, which the framework already has, and the UserService, which it has yet to create. The UserService has no dependencies so the dependency injection framework can just use new to instantiate one

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos