File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,29 @@ wiring (injection) of property references and config placeholders.
1616
1717<a name =" usage " >Usage</a >
1818--------------------------------
19+ ### Browser
20+
21+ The module is also able to be used directly in the browser, in combination with the logger and config modules.
22+ You can either import the ApplicationContext globally as an IIFE (Immediately Invoked Function Expression),
23+ as follows:
24+
25+ ``` html
26+ <script src =" https://cdn.jsdelivr.net/npm/@alt-javascript/cdi/dist/alt-javascript-applicationcontext-iife.js" ></script >
27+ <script >
28+ import { SimpleClass } from ' ./index.js' ;
29+
30+ const applicationContext = new ApplicationContext (SimpleClass);
31+ </script >
32+ ```
33+
34+ Or import the ES6 module bundle from a module, as follows:
35+
36+ ``` javascript
37+ import { ApplicationContext } from ' https://cdn.jsdelivr.net/npm/@alt-javascript/cdi/dist/alt-javascript-cdi-esm.js'
38+ import { SimpleClass } from ' ./index.js' ;
39+
40+ const applicationContext = new ApplicationContext (SimpleClass);
41+ ```
1942
2043### Singleton Components
2144
You can’t perform that action at this time.
0 commit comments