select/src/option/option.component.ts
Option represents a single option in the context of a Select. Each Option has a value property that can be used to set the value that will be selected if the user chooses this option. The content of the Option is displayed in the Select's dropdown list.
// Component class
protected sampleForm: FormGroup = new FormGroup({
size: new FormControl('m'),
});<!-- Component template -->
<form [formGroup]="sampleForm">
<talenra-form-field label="Size">
<talenra-select formControlName="size">
<talenra-option value="s" label="S" />
<talenra-option value="m" label="M" />
<talenra-option value="l" label="L" />
</talenra-select>
</talenra-form-field>
</form>import { OptionComponent } from '@talenra/components/select';See FormFieldComponent See SelectComponent
| changeDetection | ChangeDetectionStrategy.OnPush |
| host | { |
| selector | talenra-option |
| imports |
IconComponent
TooltipDirective
|
| styleUrls | ./option.component.scss |
| templateUrl | ./option.component.html |
Inputs |
| icon |
Type : string
|
Default value : ''
|
|
The icon to be displayed beside the label. See |
| terminated |
Type : boolean, unknown
|
Default value : false, { transform: booleanAttribute }
|
|
Determines whether the option is terminated (expired). Terminated options are never displayed to users in the options list and thus cannot be picked by users. The only purpose of terminated options is to provide a label we can display to the user in case the Select's value is prefilled with the terminated value. Typical use case: Legacy support for a value that has been removed (e.g. expired values). Example :See SelectComponent |
| value |
Type : any
|
Default value : undefined
|
|
The option's value. Might differ from the label shown to the user. |