I want to use different value for a injection token in a module conditionally, something like:
providers: [
{
provide: ABC_TOKEN,
useValue: useA ? a : b,
},
],
how to do that?
and also I want to pass the useA
from a routing module which maybe something like:
{
path: 'abc',
loadChildren: () =>
import('../abc.module').then(
(m) => m.AbcModule,
),
data: {
useA: true,
},
},
So what I want is based on the data in the routing module, I want to use different value of injection token for the module
Thanks.