R
R
Roman Rakzin2022-01-19 18:58:10
Angular
Roman Rakzin, 2022-01-19 18:58:10

How to isolate the admin module from the entire site in Angular?

I now have a common app Module for the entire project and lazy loading for each url, including the admin url.
Since the application is expanding - I want to somehow separate at the very initial level - whether this is a regular user or an administrator, and if he is an administrator, then do not load unnecessary modules from the app Module and only then go through lazyLoad of the specific module for the link.
I have a parameter stored in localstorage - the admin is either a user, and in case of an "api hack" the server will not respond to the admin data if the user is not an admin.
The bottom line is that I can’t write a new site, since the customer decided to make both admins and users on the same site, but I want to isolate these 2 entities altogether and make the admin modules as fast as possible, without unnecessary data and any Shared modules from the usual functionality site.
In fact, the site is from scratch, but inside the current one (Maybe somehow in bootstrap, immediately upon loading, not load the appModule, but load the AdminModule in which a completely different infrastructure)

Actually, the question is how to implement this, so that without jambs and to completely isolate 2 sites, with this, what would the assembly be one?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shvets, 2022-01-19
@TwoRS

looks like nested applications
https://medium.com/disney-streaming/combining-mult...
i.e. you need to make the root app first, paste the existing one there, and add another admin one on the side.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question