Layout with parameterized RoutePrefix

I want to create a layout for my apps customer section where the routes are something like "/:customerId/dashboard

In my layout i have the RoutePrefix(":customerId) annotation with a BeforeEnterObserver to fetch the customers information for all the views with said layout.

In my layout, i receive the event with the parameter like expected but then i get “No route found for the given navigation target ‘*.CustomerDashboard’ and parameters ‘{}’”

Apparently the router finds the correct view and the layout i defined for it but then somehow the parameter gets lost in the event propagation or something.

Is this not the intended way to do it or should i not handle route parameters with layouts in general?

Solved it by setting the RoutePrefix optional like so “:customerId?” and then doing a redirect with a BeforeEnterObserver in my layout. Works great for my case but doesn’t seem like an perfect solution because the parameter is not actually optional