🚀 - Use providers to inject default configurations
See original GitHub issue🚀 Feature request
Is your feature request related to a problem?
I would like to adjust the default values for several inputs on different components. In our project for instance, we would like to use the checkbox component in size l
. Given the current implementation, we need to add the size input to every checkbox. It would be nice to globally define the default values via a configuration provider. Similar functionality exists on Angular Material and other frameworks.
Describe the solution you’d like
import {TUI_CHECKBOX_DEFAULT_OPTIONS} from '@taiga-ui/kit';
...
{
imports: [TuiRootModule, ...],
providers: [{
provide: TUI_CHECKBOX_DEFAULT_OPTIONS,
useValue: {
size: 'l'
}
}],
...
}
export class AppModule {}
Describe alternatives you’ve considered
The only alternative currently is to set the size input on every checkbox.
Additional context
Ideally, this would be available for every component and not only for checkboxes. We can help provide PRs if you like the idea.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Configuring dependency providers - Angular
If you specify the service class as the provider token, the default behavior is for the injector to instantiate that class using the...
Read more >Angular 2 DI injects same instance of clonned object with ...
So the idea is to get default config of scrollbar and then extend injected object in each component, so each component has own...
Read more >Overriding dependencies in the Angular injector hierarchy
Angular allows dependencies provided through the injector of a parent component to be shared among its child components by injecting them ...
Read more >Configuration provider - Dependency Injector
This page demonstrates how to use Configuration provider to inject the dependencies, ... Dependency Injector doesn't install pydantic by default.
Read more >Understand Angulars Hierarchical Dependency Injection system
By default, services registered to Angular are application wide but we ... messages = [ '10 rockets built', 'new configurations available' ]; ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe the library is mostly covered by tokens now. If anything is still needed, a separate issue can be opened.
Huge thanks to everyone who contributed to getting this done, namely @fynnfeldpausch, @KarimovDev, @mullinsmikey and @zarghamkhandev, you rock! 👍
@vladimirpotekhin could you add configuration for
InputTime
next, please?