Angular 6:多页面应用程序(MPA)是否可行?

Ami*_*hah 10 single-page-application angular multi-page-application

在Google上度过了一整天之后,我的问题仍未得到答复.

因为我是使用6.0.4版创建Angular应用程序的新手.我的第一个简单问题是:

  1. 是否可以使用多级登录页面配置Angular应用程序?

    示例:如果没有公开根页面顶部导航栏上的链接,我需要直接链接到这些页面,用户拥有自己的不同菜单.喜欢:WordPress /管理面板与其网站不同.

    • /home 为公众观点
    • /admin 登录后的管理部分
    • /customer 登录后的客户部分

这是因为我发现只有一个app.component.html文件,我们可以使用路由包含我们的组件,但顶部有静态导航栏.

  1. 如果不:

    如何运行为以上3个部分创建的多个应用程序可以在同一个下运行url:port

Ami*_*hah 6

解决了

按照这个:https : //angular.io/guide/lazy-loading-ngmodules

注意:最后必须注释掉导航按钮app.component.html

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

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

<router-outlet></router-outlet>
Run Code Online (Sandbox Code Playgroud)