File

src/ui/radio-set/smart-radio-set.component.ts

Implements

OnInit

Metadata

selector smart-radio-set
styleUrls ./smart-radio-set.component.css
templateUrl ./smart-radio-set.component.html

Index

Properties
Methods
Inputs
Outputs
Accessors

Constructor

constructor(elementRef: ElementRef)
Parameters :
Name Type Optional
elementRef ElementRef No

Inputs

enabled
Type : boolean
id
Type : string
orientation
Type : string
smartModel
Type : string
style
Type : any
value-list
Type : string[]

Outputs

smartModelChange
Type : EventEmitter<string>

Methods

Public onValueChanged
onValueChanged(event: any, key: string)
Parameters :
Name Type Optional
event any No
key string No
Returns : void

Properties

visible
Default value : true

Accessors

enabled
getenabled()
Returns : boolean
setenabled(value: boolean)
Parameters :
Name Type Optional
value boolean No
Returns : void
ngModel
getngModel()
Returns : string
setngModel(value: string)
Parameters :
Name Type Optional
value string No
Returns : void
radioItems
getradioItems()
Returns : RadioItem[]
setradioItems(value: [])
Parameters :
Name Type Optional
value [] No
Returns : void

<div [ngClass]="{ 'k-form-field': true, vertical: orientation === 'vertical', horizontal: orientation === 'horizontal' }" [ngStyle]="style || {}" [hidden]="!visible" >
    <div *ngFor="let r of radioItems; let i = index;" [class]="orientation">
        <input type="radio" name="group" [id]="'radio'+i" class="k-radio" [value]="r.key" [disabled]="!enabled" (change)="onValueChanged($event, r.key)" [ngModel]="ngModel"/>
        <label class="k-radio-label" [for]="'radio'+i">{{r.value}}</label>
    </div>
</div>

./smart-radio-set.component.css


.horizontal {
    display: inline;
}


.k-form-field.vertical { 
    display: block !important; 
}
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""