I would like to read optional URL parameters, no matter query or matrix parameters, in the component bootstrapped by Angular, this while/in ngOnInit().
As far as I understood, "ActivatedRoute" is not available in a component not loaded in outlet, so with an index.html like:
<body>
<app-root>Loading...</app-root>
</body>
and app.module.ts file containing:
bootstrap: [AppComponent]
if, and how, would it be possible to access a parameter from i.e. http://localhost:4200/my-component/id;param1=abc ?
@Component({
selector: 'app-root',
template: '<router-outlet></router-outlet>',
styles: []
})
export class AppComponent implements OnInit {
constructor(private router: Router) {
... ?
}
ngOnInit(): void {
... ?
}
}