import module in condition based
See original GitHub issueIs there a way to import module or add component to main module on condition based
ex:
@Module(
{
modules: [ModuleA, ModuleB, ModuleC]
})
In this in some place i need only ModuleA, not ModuleB and ModuleC, but in some condition, I will be using ModuleB and not others.
Is there a way to import here based on some condition…
Also, I have the same situation in component loading. is that possible in components too? I would be happy if I have any one of these
Nest version: 4.6.4
For Tooling issues:
- Node version: 8.9.4
- Platform: Windows
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Conditional import of modules in Python - Stack Overflow
In my program I want to import simplejson or json based on OS being Linux or Windows. I take the OS name as...
Read more >Dynamically/conditionally importing JavaScript modules
Dynamic imports are a great way to specify dynamic paths to import modules, as well as conditionalise whether they should be imported at...
Read more >Conditional imports in one line using `else` - Ideas
Conditional imports are somewhat common in code that supports ... Choosing a module based on a condition (if for some reason you need...
Read more >Learning about Python Conditional Import
Python conditional import comes into use while importing modules. In python, modules are pieces of code containing a set of functions that ...
Read more >Conditional module imports in Angular | by Luuk Gruijs - Medium
Conditional module imports in Angular ... Whenever you're introducing third-party services to your Angular application there are cases that you need those ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Okay, i know someone can help with that 😃
cc @bashleigh
I think you are looking for
Dynamic Modules
see here https://docs.nestjs.com/modules at the end of this page.in Dynamic Module you should have control of what will be included in
components
array, and soimports
.