label required
This commit is contained in:
parent
21ba057390
commit
3d8860870a
|
@ -4,12 +4,12 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="form-group col-md-12">
|
<div class="form-group col-md-12">
|
||||||
<label>Label</label>
|
<label>Label</label>
|
||||||
<input type="text" class="form-control" formControlName="label" id="label">
|
<input type="text" class="form-control" formControlName="label">
|
||||||
<!-- <div *ngIf="form.get('label').invalid && (form.get('label').dirty || form.get('label').touched)" class="alert alert-danger"> -->
|
<div *ngIf="form.get('label').invalid && (form.get('label').dirty || form.get('label').touched)">
|
||||||
<!-- <div *ngIf="form.get('label').errors.required" class="alert alert-danger">
|
<div *ngIf="form.get('label').errors.required" class="alert alert-danger">
|
||||||
Name is required.
|
Label is required.
|
||||||
</div> -->
|
</div>
|
||||||
<!-- </div> -->
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -67,8 +67,7 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="btn btn-primary" style="margin-top:20px;" type="submit">Save</button>
|
<button class="btn btn-primary" style="margin-top:20px;" type="submit" [disabled]="!form.valid">Save</button>
|
||||||
<!-- [disabled]="!form.valid" -->
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<p>Form value: {{ form.value | json }}</p>
|
<p>Form value: {{ form.value | json }}</p>
|
||||||
|
|
|
@ -38,7 +38,7 @@ export class SectionFormComponent {
|
||||||
// (<FormArray>this.form.get("fieldGroups")).push(fieldGroup.buildForm());
|
// (<FormArray>this.form.get("fieldGroups")).push(fieldGroup.buildForm());
|
||||||
// }
|
// }
|
||||||
|
|
||||||
addField() {debugger;
|
addField() {
|
||||||
let fieldSet: FieldSet = new FieldSet();
|
let fieldSet: FieldSet = new FieldSet();
|
||||||
let field: Field = new Field();
|
let field: Field = new Field();
|
||||||
//let fieldGroup: FieldGroup = new FieldGroup();
|
//let fieldGroup: FieldGroup = new FieldGroup();
|
||||||
|
|
|
@ -36,7 +36,7 @@ export class DatasetProfileModel extends BaseModel implements Serializable<Datas
|
||||||
// })
|
// })
|
||||||
formGroup.addControl('pages', this.formBuilder.array(pagesFormArray));
|
formGroup.addControl('pages', this.formBuilder.array(pagesFormArray));
|
||||||
|
|
||||||
formGroup.addControl('label', new FormControl(this.label));
|
formGroup.addControl('label', new FormControl(this.label, Validators.required));
|
||||||
return formGroup;
|
return formGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue