I am trying to eliminate the title and toolbar from some paths, I do see here where we have it,
<ng-container *ngIf="appToolbarDisplay">
<app-toolbar class="app-toolbar" [ngClass]="appToolbarCSSClass" id="kt_app_toolbar"
[appToolbarLayout]="appToolbarLayout"></app-toolbar> {
path: "locations",
loadChildren: () =>
import("./locations/locations.module").then((m) => m.LocationsModule),
data:{ appToolbarDisplay: false}
}, Hi Kenneth,
It seems the option is not there. Here's how you can do it:
import { Router, NavigationEnd } from '@angular/router';
import { filter } from 'rxjs/operators';
// ...
export class YourComponent {
shouldShowToolbar: boolean = true; // Set the initial value
constructor(private router: Router) {
router.events.pipe(
filter(event => event instanceof NavigationEnd)
).subscribe((event: NavigationEnd) => {
const currentPath = event.url;
console.log('Current Path:', currentPath);
// Update the boolean based on the current path
this.shouldShowToolbar = currentPath !== '/exclude-toolbar';
});
}
}
< ng-container *ngIf="shouldShowToolbar">
< app-toolbar class="app-toolbar" >
< /ng-container>
In this example, the shouldShowToolbar variable is initially set to true. Then, in the subscription to the router events, it's updated based on the current path. The toolbar will only be displayed if shouldShowToolbar is true.
Remember to adjust the path ('/exclude-toolbar' in this case) based on your specific use case.
Thanks