本文整理汇总了TypeScript中@ng2-dynamic-forms/core.DynamicFormService类的典型用法代码示例。如果您正苦于以下问题:TypeScript DynamicFormService类的具体用法?TypeScript DynamicFormService怎么用?TypeScript DynamicFormService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DynamicFormService类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(private formService: DynamicFormService) {
//this.formModel1 = BASIC_EXAMPLE_MODEL;
//this.formModel2 = BASIC_EXAMPLE_ARRAY_MODEL;
this.formModel1 = this.formService.fromJSON(JSON.stringify(BASIC_EXAMPLE_MODEL));
this.formModel2 = this.formService.fromJSON(JSON.stringify(BASIC_EXAMPLE_ARRAY_MODEL));
this.formGroup1 = this.formService.createFormGroup(this.formModel1);
this.formGroup2 = this.formService.createFormGroup(this.formModel2);
}
示例2: beforeEach
beforeEach(inject([DynamicFormService], (service: DynamicFormService) => {
formGroup = service.createFormGroup(formModel);
component.group = formGroup;
component.model = formModel[0];
fixture.detectChanges();
inputElement = debugElement.query(By.css(`input[id='${formModel[0].id}']`));
}));
示例3: beforeEach
beforeEach(inject([DynamicFormService], (service: DynamicFormService) => {
formGroup = service.createFormGroup(formModel);
component.group = formGroup;
component.model = formModel[0];
fixture.detectChanges();
selectElement = debugElement.query(By.css(`kendo-dropdownlist`));
}));
示例4: ngOnInit
ngOnInit() {
this.checkboxControl = this.formGroup1.controls["basicCheckbox"] as FormControl;
this.checkboxModel = this.formService.findById("basicCheckbox", this.formModel1) as DynamicCheckboxModel;
this.arrayControl = this.formGroup2.controls["basicFormArray"] as FormArray;
this.arrayModel = this.formService.findById("basicFormArray", this.formModel2) as DynamicFormArrayModel;
}
示例5: clear
clear() {
this.formService.clearFormArray(this.arrayControl, this.arrayModel);
}
示例6: remove
remove(index: number) {
this.formService.removeFormArrayGroup(index, this.arrayControl, this.arrayModel);
}
示例7: add
add() {
this.formService.addFormArrayGroup(this.arrayControl, this.arrayModel);
}