Here is the code snippet for my component:
import { Component } from '@angular/core';
import { Router, ActivatedRoute, NavigationStart } from '@angular/router';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
showMenu:any='';
constructor(router:Router) {
router.events.forEach((event) => {
if(event instanceof NavigationStart) {
this.showMenu = event.url !== "/newsection";
console.log(event.url);
}
});
}
}
An error message I am encountering states:
ReferenceError: NavigationStart is not defined