Search code examples
inversifyjs

How to implement inversifyJS basic example intro html page


I can't find example with html page or any live example for browsers (html page).

I need basic example just what to import lib and make one class.

I found on http://inversify.io :

InversifyJS compiles to clean, simple JavaScript code which runs on any browser, in Node.js, or in any JavaScript engine that supports ECMAScript 5 (or newer).


Solution

  • To use InversifyJS in a web browser you are going to need Webpack. You need to bundle your app just like when working with any other frontend library these days. We don't have an official example but I found this blog https://blog.kloud.com.au/2017/03/22/dependency-injection-in-vuejs-app-with-typescript/ and the code is available on GitHub https://github.com/devkimchi/Vue.js-with-ASP.NET-Core-Sample/tree/master/src/VueJsTsIocSample