angular-jsf-components
Version:
JSF Compliant Angular Components
39 lines (32 loc) • 1.14 kB
text/typescript
import {Component, ElementRef, Input, OnInit, TemplateRef, ViewChild,} from '@angular/core';
import {random} from 'lodash';
import {HFormService} from '../../services/h-form.service';
import {JsfCore} from '../../superclass/jsf-core';
({
selector: 'f-select-item',
templateUrl: './f-select-item.component.html',
styleUrls: ['./f-select-item.component.css'],
})
export class FSelectItemComponent extends JsfCore implements OnInit {
()
value: any;
()
itemLabel: string;
()
noSelectionOption: boolean;
currentValue: () => any;
radioCallback: (event: Event) => void;
('radio') radio: TemplateRef<any>;
('option') option: TemplateRef<any>;
('radioInput') radioInput: ElementRef;
('optionElem') optionElem: ElementRef;
private radioId = this.hFormService.getFormId(this.id) + random(0, 10000);
constructor(private hFormService: HFormService, elementRef: ElementRef) {
super(elementRef);
}
ngOnInit() {
if (this.noSelectionOption) {
this.value = '';
}
}
}