【发布时间】:2018-11-16 21:15:25
【问题描述】:
我有一个分为以下模块的应用程序:
/app
/core
/admin
/authentication
/wst
Admin 是一个带有侧边栏的复杂模块,而身份验证只是一个登录屏幕。我只想在管理模块处于活动状态时才加载侧边栏,并且我不想将它包含在带有 *ngIf 的 app.component.html 中。
我怎样才能使这样的配置工作? 我正在使用 Angular7,并启动了 stackblitz that shows my problem。
- 如果我将路由器插座添加到 app.component.html,例如。 /login 路线有效 很好。
- 如果我尝试对 /admin 进行相同操作,则没有任何显示。
【问题讨论】:
标签: angular typescript angular-routing