Why queryParams are empty
I'm using javascript, it's working very nice :
var action = new URLSearchParams(window.location.search).get('action');
Because component is loaded before the actual routing applied.
Add { enableTracing: true }
to the RouterModule
to see what is happening behind the scene.
RouterModule.forRoot([], { enableTracing: true })
https://stackblitz.com/edit/angular-boghpy?file=src/app/app.module.ts