Reputation: 695
I want to create an angular4 application that has two sections to it.
The first section would be the main site where the user can toggle through the site and view the material.
The second section would be an admin part of the site, where the owner of the site can come and update their blog, add/remove pictures etc.
I am trying to figure out how to achieve this and I am having a little trouble understanding how to do it. I have seen some suggestions saying that I could do it by creating two separate apps. How would this work, I am not sure. would I just create the first app by ng new app1 and the second in the same directory by ng new app2?
Or could I create two separate modules. I don't fully understand how modules work, but from what I think I understand, I could have the main app on one module and the admin app on a different module. each module would then have its separate components. I have just started learning Angular4 and am very confused by all the information I am reading about how to do this. If someone could explain how it is best done that would be awesome.
Upvotes: 0
Views: 200
Reputation: 1264
You only need 1 app to do what you want by using route guard, simply after user login route guard will check if user is normal member or admin and then it navigates "right" parts of website depend on user's hierarchy https://angular.io/guide/router#milestone-5-route-guards
Upvotes: 0
Reputation: 954
for both suggestions, you need to have one server-side application which stores your data.
Upvotes: 1