provideMulti
Generic types: | T |
Type-safe factory function for producing multi
configs.
See Also
Presentation
function provideMulti (config : ProvideMultiConfig <T>): Provider ;
Returns
Parameters
Name | Type | Description |
---|---|---|
config |
| type-safe configuration object |
Example usage
provideMulti ({ token: TitleStrategy , useClass: AppTitleStrategy });
// Type error. TitleStrategy does not support multi providing.
// Argument of type '{ token: typeof TitleStrategy ; useClass: typeof AppTitleStrategy; }' is not assignable to parameter of type 'never '.
provideMulti ({ token: APP_INITIALIZER , useFactory: () => () => {} });
// Legit. The return type of the factory matches the item type of APP_INITIALIZER