Reputation: 37780
I'm looking for a way to write plugin-based Angular application using Visual Studio and ASP .NET Core SPA project template.
I'm newbie to Angular, and I still reading the docs.
It looks like router + lazy loaded modules is what I need. Main application doesn't need to refer these modules directly, and only appropriate routes configuration is required.
Also, some web search shows, that router can be reconfigured dynamically. E.g. main app calls my API, which returns available routes, built from plugins list somehow.
The question is how lazy loaded angular modules will fit VS project system. All Angular + VS samples I found are using single VS project.
But I need something similar to C#/.NET. For example, typical plugin-based C# app consists of:
IPlugin
;PluginHost
, which knows about IPlugin
and can load its implementations;IPlugin
implementations.That is, someone can develop his own implementation, copy resulting assembly into app directory, re-run app, and get new functional.
Is there any way to achieve this using Angular and Visual Studio (not VS Code)?
Upvotes: 2
Views: 442
Reputation: 19578
You might want to design your common stuff and your implementations as angular libraries (ng generate library
).
There are a few ways to pack this together - from Monorepo (which you apparently do not want to use) to building them all as separate libraries, but the main thing is still that you'd just import these libraries from npm as any other package (or as Angular itself) and use their exported APIs.
There are a few resources on this, e.g. this, this or this.
Now, how to proceed further than this, maybe read up a bit more and then post more specific questions.
Upvotes: 3