I can't seem to export the Container object I made, it becomes undefined.
src/di/di_inversify.js:
'use strict';
import { Container, decorate, injectable, inject } from 'inversify';
import 'reflect-metadata';
//...more code
const myLib = container.get(TYPES.MyLib);
console.log(myLib); // <--- this prints "_class { randomLib: _class {} }" which is correct, it works here
export default {
myLib: myLib // <--- this is where I export the object
};
I have another file which includes this file and wants to access the container object.
src/lib/some_library.js:
import { myLib } from 'src/di/di_inversify';
console.log(myLib); // <--- this prints "undefined"
I can't seem to export the Container object I made, it becomes undefined.
src/di/di_inversify.js:
I have another file which includes this file and wants to access the container object.
src/lib/some_library.js:
I'm guessing there is something I've missed with InversifyJS, the vanilla JavaScript examples display all the code in one file and not split up so I have no reference. https://github.com/inversify/InversifyJS/blob/master/wiki/basic_js_example.md