I have a variable in a component with a predefined value path.
After upgrading from Angular 6.0 to 6.1.7, it is showing as undefined
export class AppComponent implements OnInit {
path: string = '/';
constructor(public route: Router) {
console.log(this.path)
}
ngOnInit() {
this.route.events.subscribe((route)=>{
this.path = (route as any).url;
})
this.getFeatured();
}
}
Statement causing error in template:
*ngIf="!path.includes('/reports') && !path.includes('/reviews') && !path.includes('/users')"
I do not think its an async issue since it logs it into the console:


AppComponentcomponent or is it the template of a different one?