sounds like a weird use case but I should have more detail to understand deeper.
Anyway, my suggestion is using the right combination of the resolution modifiers
https://angular.dev/guide/di/hierarchical-dependency-injection#resolution-modifiers