I want a subset of pages of my site to have sidebar navigation.
So, the home page and others would not have any sidebar, but one section of the site would have a sidebar. On that section, users can click on sidebar menu items to navigate to different pages within that section.
This is the same structure as Angular Material uses on its main site.
If you go to the home page, there is no sidebar. But, if you go to the components page, there is a sidebar, and you can click on sidebar menu items to navigate within the components section of the site.
How can I accomplish this structure using Angular Material's sidenav component?
Here are some more details in case helpful:
The documents say that mat-sidebar is for adding a sidebar to the whole site, and that mat-drawer is just for one section, so I assume I would use mat-drawer. But I don't find any examples of implementation for adding sidebar nav to one section. The tricky part is efficient code that enables me to navigate among different routes in the given section.
The basic code is like this:
html:
<mat-drawer-container class="example-container">
<mat-drawer mode="side" opened>Drawer content</mat-drawer>
<mat-drawer-content>Main content</mat-drawer-content>
</mat-drawer-container>
Often, you put this in app.component.html, and put in <router-outlet></router-outlet>
where "Main Content" is in the code.
How do you do this when the sidebar navigation should not be for the whole site's router-outlet, but just the routes for particular components?