Component not getting displayed while using material theme

前端 未结 1 703
生来不讨喜
生来不讨喜 2021-01-27 06:20

I am not getting what is happening here. I have following components,

1) app.component 2) Dashboard component. 3) Login component 4) Home component ( child of dashboard

1条回答
  •  一向
    一向 (楼主)
    2021-01-27 06:49

    The problem is you are using mat-sidenav without mat-sidenav-content, you can even check that your sidenav is taking the whole screen.

    The simple solution is you don't need that header component. Simply use that header component code in your dashboard component and put that router-outlet insdie your dashboard componenet mat-sidenav-content tag.

    Example:

    dashboard.component.html

    Hello


    change the dashboard.component.ts as per the header.component.ts

    0 讨论(0)
提交回复
热议问题