alert mandatory monitoring list
This commit is contained in:
parent
b195055651
commit
9529da581a
|
@ -68,15 +68,9 @@
|
||||||
<i class="feather ft-plus"> New Building</i>
|
<i class="feather ft-plus"> New Building</i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<small
|
<div *ngIf="projectInfo.get('buildingId').touched && projectInfo.get('buildingId').invalid" class="text-danger">
|
||||||
class="form-text text-muted danger"
|
Building is required.
|
||||||
*ngIf="submitted && f.buildingId.errors"
|
</div>
|
||||||
class="invalid-feedback"
|
|
||||||
>
|
|
||||||
<div *ngIf="f.buildingId.errors.required">
|
|
||||||
Building is required
|
|
||||||
</div>
|
|
||||||
</small>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="floorId" style="color: #242222"
|
<label for="floorId" style="color: #242222"
|
||||||
|
|
|
@ -294,6 +294,7 @@ export class AddEditListComponent {
|
||||||
save() {
|
save() {
|
||||||
if (this.mode === "add") {
|
if (this.mode === "add") {
|
||||||
if (this.projectInfo.invalid) {
|
if (this.projectInfo.invalid) {
|
||||||
|
this.markFormGroupTouched(this.projectInfo)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const formData = this.projectInfo.value;
|
const formData = this.projectInfo.value;
|
||||||
|
@ -318,6 +319,15 @@ export class AddEditListComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
markFormGroupTouched(formGroup: FormGroup) {
|
||||||
|
(Object as any).values(formGroup.controls).forEach((control) => {
|
||||||
|
control.markAsTouched();
|
||||||
|
if (control.controls) {
|
||||||
|
this.markFormGroupTouched(control);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
cancel() {
|
cancel() {
|
||||||
this.router.navigate(["/list-monitoring"]);
|
this.router.navigate(["/list-monitoring"]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue