I'm using an Angular plugin, which needs to be configured by providing a configuration object using an InjectionToken
that the plugin exports.
import { pluginToken } from 'plugin';
@NgModule({
providers: {
// Configure the plugin
//
// The configuration value string needs to be taken from some other
// provider (available for dependency injection).
{ provides: pluginToken, useValue: valueString },
},
})
class MyModule {
...
}
The problem I have is that valueString
is a value from some other provider. I don't know how to inject a dependency into @NgModule
decorator's provider. How it can be done?