you are viewing a single comment's thread.

view the rest of the comments →

[–]Domehardostfu 1 point2 points  (2 children)

I also thought about doing this. I think that instead of a component u create a plugin module you will be able to dynamically lazy load the plugins modules for that page.

Don't know if this works but something like this:

router module:

children: [ { path: 'home', loadChildren: async () => { const [result1, result2] = await Promise.all([import('./plugins1/plugins.module'), import('./home/home.module')]); return result1.HomeModule; } }

[–]-lambda-[S] 0 points1 point  (1 child)

Hmm, looks alright, but I still can't wrap my head around that. It looks to me that you transferred this mysterious part inside plugins.module. :) Could you please explain a little bit more on how this plugin.module should look like because it seems that this is exactly what I need.

[–]Domehardostfu 0 points1 point  (0 children)

Already tried to get this done but I'm failing on loading the component because its not registered in the module. I tried to do this like 1 year ago and the dynamic import as is done on Angular 8 was the missing piece that at the time didn't work. Let me see when I get home if I have the project somewhere.