Hi Albert,
Thanks for contacting Syncfusion support.
We understood your requirement to show different Sidebars in the main page and subpages of your application.
In a Single page application, this can be achieved by showing or hiding the Sidebars in the routing event of your application, wherein the sidebars will be shown or hidden in the Angular router navigation events.
We have prepared a sample based on your requirement. Please check the below Stackblitz link.
[app.component.ts]
export class AppComponent implements AfterViewChecked {
@ViewChild('sidebar')
public side: SidebarComponent;
public urlValue: String;
title = 'Synfusion Sidebar';
constructor(router: Router) {
router.events.forEach((event) => {
if (event instanceof NavigationEnd) {
this.urlValue = event.url;
}
});
}
ngAfterViewChecked() {
if (this.urlValue !== "/") {
this.side.hide();
} else {
this.side.show();
}
}
} |
Regards,
Deepa L.