Conversation
- Add dev sample
…into iganchev/input-group-token-master
projects/igniteui-angular/src/lib/input-group/input-group.component.spec.ts
Outdated
Show resolved
Hide resolved
projects/igniteui-angular/src/lib/input-group/input-group.component.ts
Outdated
Show resolved
Hide resolved
| */ | ||
| @Input() | ||
| public type = 'line'; | ||
| public set type(value: IgxInputGroupType) { |
There was a problem hiding this comment.
This implementation works fine, but I feel like it should be the same as in the IgxInputGroup component. If we expose the input to be templateable or if (for some reason) a user passes items that have and input in them, those should behave consistently w/ the input group from the view template. So the select component should get the InputGroupToken injected in it's constructor (optional) and type should return this._type || this._inputGroupToken || 'line'. As we are passing any specified type to the input in the template, there should be no inconsistencies when it is provided.
@IvayloG , @damyanpetev , thoughts?
There was a problem hiding this comment.
I don't think might be an issue, but the input group child may one day not be static and interfere with this setter. So I'd still go that route anyway.
| */ | ||
| @Input() | ||
| public type = 'line'; | ||
| public set type(value: IgxInputGroupType) { |
There was a problem hiding this comment.
I don't think might be an issue, but the input group child may one day not be static and interfere with this setter. So I'd still go that route anyway.
| * Defines the InputGroupType DI token. | ||
| */ | ||
| // Should this go trough Interface https://angular.io/api/core/InjectionToken | ||
| export const InputGroupToken = new InjectionToken<IgxInputGroupType>('InputGroupType'); |
There was a problem hiding this comment.
I'd take the more fitting token name of IGX_INPUT_GROUP_TYPE
| /** | ||
| * An @Input property that sets how the select will be styled. | ||
| * The allowed values are `line`, `box` and `border`. The default is `line`. | ||
| * The allowed values are `line`, `box` and `border`. The input-group default is `line`. |
There was a problem hiding this comment.
Nit-pick, but this change isn't really needed
Closes #6751
Additional information (check all that apply):
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)