Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 6: Multi Page Application (MPA) is possible?

After spending the whole day on Google, my question remains unanswered.

As I am new to creating Angular app using version 6.0.4. my first and simple question is:

  1. Is it possible to configure Angular app with multilevel landing pages?

    Example: Without exposing the links on top nav bar of the root page, I need direct links to these pages where the users have their own different menus. like: WordPress/admin panel is different than its website.

    • /home for public view
    • /admin for admin section after login
    • /customer for customer section after login

this is because I found that there is only one app.component.html file where we can include our components using Routing but with static navigation bar on the top.

  1. If not:

    How to run multiple apps created for all above 3 section can be run under the same url:port?

like image 699
Amit Shah Avatar asked Jun 10 '18 15:06

Amit Shah


Video Answer


1 Answers

SOLVED

By following this: https://angular.io/guide/lazy-loading-ngmodules

NOTE: at the end must comment out the navigation buttons in the app.component.html

<!--
<h1>
  {{title}}
</h1>

<button routerLink="/customers">Customers</button>
<button routerLink="/orders">Orders</button>
<button routerLink="">Home</button>
-->

<router-outlet></router-outlet>
like image 138
Amit Shah Avatar answered Sep 21 '22 21:09

Amit Shah