Skip to content

BottleJS is a dependency injection container useful when you want to pass dependencies through the constructor

Notifications You must be signed in to change notification settings

akaiserg/TestingBottleDI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Testing BottleJs DI micro container

BottleJS has many features that can be used to make complex modules. For instance:

  • Lazy loading
  • Service Factory
  • Decorators
  • Middleware

Unlike the di-lite, BottleJS passes the dependencies through the constructor of each module and it doesn't have a special attribute to define the list of dependencies, therefore, each module definition is much cleaner.

var AppModule= function(htmlIdModule,languageModule){.......

 // Factory  to  generate  the instance of   the english app
    bottleDi.factory('appModuleEnglish', function(container) {
        var englishTxtModule = container.englishTxtModule;
        var htmlId = new HtmlIdModule("btn2_id","txt2_id");
        return new AppModule(htmlId,englishTxtModule);
    });


});

About

BottleJS is a dependency injection container useful when you want to pass dependencies through the constructor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published