The Web Sample for DI

Running

Open the browser console to see console log (F12, "Console" tab).

Expected output:

Sample Lib: Creating logger for 'Sample Lib'.
Sample Lib: New instance of the service 'Sample_Lib_Service' is created for the app 'Sample Lib'.
Sample App: Library service running with 'Hello from the Web!' param.

Running as Node app

Clone, install, and run:

$ git clone https://github.com/flancer64/demo-di-app.git
$ cd demo-di-app/
$ npm i
$ npm start
...
Sample Lib: Creating logger for 'Sample Lib'.
Sample Lib: New instance of the service 'Sample_Lib_Service' is created for the app 'Sample Lib'.
Sample App: Library service running with 'Hello from the Node.js!' param.

Overview

This is a web entry point to demonstrate the usage of the same JavaScript code in the browser and Node.js without any transformations, just with dependency injection:

the scheme of components