I know this has been asked many times and I have tried to look for a solution.
My current URL is: http://localhost:4200/configuration
Below is one of the many online found solutions I am trying to implement.
export class AppComponent implements OnInit{
title = 'app';
constructor(private router: Router, private activatedRoute: ActivatedRoute) {
}
ngOnInit() {
console.log("On Init");
console.log(this.router.url);
console.log(this.activatedRoute.url);
//this.router.navigate(['/login']);
}
}
On reload of page I get below output.
On Init
\
I am just getting empty url. I am very curious to know what I am missing.
/configuration?