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:
1. In your component TypeScript file:
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" ></app-toolbar>
< /ng-container>