Usually I'd go like this in my component.
import { Router } from "@angular/router";
@Component({ ... })
export class CompyTheComponent {
constructor(private router: Router) {
console.log(router.url);
}
}
What if I want to obtain a reference of it without injecting it? I've tried to create it but died on all the parameters I couldn't figure out. Ans since it's not the usual (nor recommended) way to approach it, there's not much googlearch on it.
let routy : Router = new Router(...);