Basically there is a module.ts in every created module of the app for example:
ng generate module newModuleName
then the module is created with the newModuleName.module.ts
file
In the file, there is @NgModule
with a declarations
element.
So I want to dynamically modify the declarations array to prevent all components from being loaded in memory at the same time.
How can I do that?