Reputation: 2395
I'm trying to import "SampleModuleController" class dynamiclly using webpack and call its member function as follows.
sampleModule.js
class SampleModuleController{
getSampleModuleSheet()
{
console.log("getSampleModuleSheet");
}
}
export let sampleModuleController = new SampleModuleController();
in a another class file...
async clicked(){
const getView = await import('../../controllers/sampleModule');
console.log("getView--",getView);
getView.getSampleModuleSheet();
}
but it gives me following logs and errors
Upvotes: 0
Views: 158
Reputation: 108
async clicked() {
const {sammpleModuleController: getView} = await import ('../../controllers/sampleModule');
console.log("getView--", getView);
getView.getSampleModuleSheet();
}
Upvotes: 1