get data from json
This commit is contained in:
parent
722cd8b482
commit
d5d3f5ef37
|
@ -17,7 +17,7 @@ export class CompositeFieldFormComponent {
|
|||
constructon(){}
|
||||
|
||||
ngOnInit(){
|
||||
this.addNewField();
|
||||
// this.addNewField();
|
||||
}
|
||||
|
||||
addNewField(){
|
||||
|
|
|
@ -17,7 +17,7 @@ export class FieldFormComponent {
|
|||
constructon(){}
|
||||
|
||||
ngOnInit(){
|
||||
this.addNewRule();
|
||||
//this.addNewRule();
|
||||
}
|
||||
|
||||
addNewRule(){
|
||||
|
|
|
@ -17,7 +17,7 @@ export class GroupFieldFormComponent {
|
|||
constructor(){}
|
||||
|
||||
ngOnInit(){
|
||||
this.addNewField();
|
||||
// this.addNewField();
|
||||
}
|
||||
|
||||
addNewField(){
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div>
|
||||
<div><!--style="border-style: solid;"-->
|
||||
<h4 style="text-decoration: underline;">Section</h4>
|
||||
<div [formGroup]="form">
|
||||
<div class="form-row">
|
||||
|
@ -16,9 +16,17 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="dataModel.sections">
|
||||
<div *ngFor="let section of dataModel.sections let i=index;">
|
||||
<section-form [form]="form.get('sections').get(''+i)" [dataModel]="section"></section-form>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="dataModel.fieldGroups">
|
||||
<div *ngFor="let fieldGroup of dataModel.fieldGroups let i=index;">
|
||||
<groupfield-form [form]="form.get('fieldGroups').get(''+i)" [dataModel]="fieldGroup"></groupfield-form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a (click)="addGroupField()" style="cursor: pointer">
|
||||
Add another group +
|
||||
|
|
|
@ -18,11 +18,12 @@ export class SectionFormComponent {
|
|||
constructor(){ }
|
||||
|
||||
ngOnInit(){
|
||||
this.addGroupField();
|
||||
//this.addGroupField(); //for new DatasetProfile
|
||||
}
|
||||
|
||||
addGroupField(){
|
||||
let fieldGroup:FieldGroup = new FieldGroup();
|
||||
if(this.dataModel.fieldGroups)
|
||||
this.dataModel.fieldGroups.push(fieldGroup);
|
||||
(<FormArray>this.form.get("fieldGroups")).push(fieldGroup.buildForm());
|
||||
}
|
||||
|
|
|
@ -26,7 +26,8 @@ export const TestModel = {
|
|||
"title": "",
|
||||
"description": "",
|
||||
"extendedDescription": "",
|
||||
"viewStyle": "checkBox"
|
||||
"viewStyle": "checkBox",
|
||||
"rule":[]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue