Ciaran
Ciaran

Reputation: 695

Angular4 Modules creating 2 separate apps

I want to create an angular4 application that has two sections to it.

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

Answers (2)

Tony
Tony

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

Wasif Khan
Wasif Khan

Reputation: 954

Few suggestions:

  • you can just make 1 application of angular4 for both web application. and you can distuigsh pages in routing of angular4List item
  • you can make totally 2 saperate apps. which have nothing to do with each other.

for both suggestions, you need to have one server-side application which stores your data.

Upvotes: 1

Related Questions