I want to create a admin and web section in angular and i am little bit confuse that should i create two separate projects for Admin and Web respectively. Or i can manage both in single angular 4 Application.
I want to create a admin and web section in angular and i am little bit confuse that should i create two separate projects for Admin and Web respectively. Or i can manage both in single angular 4 Application.
You can manage different sections (i.e. Admin and UserFront) in single project by creating different modules. I have a successful experiment here.
Angular.io has a nice example here.
I have several projects that contains exactly what you ask. A web project that is split into 2 (sometimes 3) different "sections" depending on the role of the user that logs in. So the roles given to the user when loggin in, defines the sections (components) exposed to the user.
According to my experience and in my situation, it is best to keep the sections in the same project, because all refactoring, optimizing etc. is done in the same project, and if a section is needed to be shared, then this is very easy because its the same project.
To manage the different sections correctly then, I have spent some time creating a solid authentication system for managing roles etc., and a solid routing system that controls the sections (You can use Angular's canActivate Guard to control what is accessible).
I must also point out, that all client sided code can never be 100% secure, you must always have server-side validation for sensitive data.