mss-engine-forms
Version:
A simple typehead library developed by MSS development team to be used for dynamic forms
19 lines • 5.88 kB
JavaScript
import { Component, Input } from "@angular/core";
import * as i0 from "@angular/core";
import * as i1 from "@angular/forms";
import * as i2 from "@angular/common";
export class DynamicRadioComponent {
constructor(formgroupDirective) {
this.formgroupDirective = formgroupDirective;
this.formName = formgroupDirective.control;
}
}
DynamicRadioComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DynamicRadioComponent, deps: [{ token: i1.FormGroupDirective }], target: i0.ɵɵFactoryTarget.Component });
DynamicRadioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DynamicRadioComponent, selector: "app-dynamic-radio", inputs: { field: "field" }, ngImport: i0, template: "<form [formGroup]=\"formName\">\n <h3>{{field.label}} <span *ngIf=\"field?.rules?.required\" class=\"red-asterisk\">*</span></h3>\n <label *ngFor=\"let option of field.options\">\n <label ngFor=\"let option of field.options\">\n <input type=\"radio\"\n [name]=\"field.fieldName\"\n [formControlName]=\"field.fieldName\"\n [value]=\"option.value\"\n >\n {{option.label}}\n </label>\n </label>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DynamicRadioComponent, decorators: [{
type: Component,
args: [{ selector: "app-dynamic-radio", template: "<form [formGroup]=\"formName\">\n <h3>{{field.label}} <span *ngIf=\"field?.rules?.required\" class=\"red-asterisk\">*</span></h3>\n <label *ngFor=\"let option of field.options\">\n <label ngFor=\"let option of field.options\">\n <input type=\"radio\"\n [name]=\"field.fieldName\"\n [formControlName]=\"field.fieldName\"\n [value]=\"option.value\"\n >\n {{option.label}}\n </label>\n </label>\n</form>" }]
}], ctorParameters: function () { return [{ type: i1.FormGroupDirective }]; }, propDecorators: { field: [{
type: Input
}] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHluYW1pYy1yYWRpby5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9tc3MtZm9ybXMvc3JjL2xpYi9jb21wb25lbnRzL2R5bmFtaWMtZmllbGQvZHluYW1pYy1yYWRpby9keW5hbWljLXJhZGlvLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL21zcy1mb3Jtcy9zcmMvbGliL2NvbXBvbmVudHMvZHluYW1pYy1maWVsZC9keW5hbWljLXJhZGlvL2R5bmFtaWMtcmFkaW8uY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLC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