I want to import my angular module using variable name as a path of that module. For an example:
When I use this code below, it's working fine:
import('src/app/modules/public/public.module').then(mod => mod.PublicModule);
But, when I try to store my module path to the some variable, It's not working. For an example, what I was trying before, It's looks like this code below:
const publicPath = 'src/app/modules/public/public.module';
import(publicPath).then(mod => mod.PublicModule);
When I trying that code above, I get some error like this:
core.js:6185 ERROR Error: Uncaught (in promise): Error: Cannot find module 'app/modules/public/public.module'
Error: Cannot find module 'app/modules/public/public.module'
Now, What should I have to do to import that module with path in a variable?
Thanks in advance.