Get router parameters in the easiest way.
Provide, inject and use the service.
@Component({
/* ... */
providers: [SchamanRouterParams],
})
class ExampleComponent {
public id$ = this.routerParams.id$;
public carId$ = this.routerParams['carId'];
public constructor(private routerParams: SchamanRouterParams) {}
}
The library uses Proxy. See compatibility.
Run nx test angular-router-params
to execute the unit tests.