reverse checkbox field fix
This commit is contained in:
parent
b945205ea4
commit
cc2e2831ea
|
@ -101,10 +101,9 @@
|
|||
</div>
|
||||
</div>
|
||||
<div *ngSwitchCase="descriptionTemplateFieldTypeEnum.CHECK_BOX" class="col-12">
|
||||
<mat-checkbox [formControl]="propertiesFormGroup?.get(field.id).get('booleanValue')" (change)="checkboxChangeEvent($event, field.id)">
|
||||
<mat-checkbox [formControl]="propertiesFormGroup?.get(field.id).get('booleanValue')">
|
||||
{{field.data.label}}</mat-checkbox>
|
||||
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('booleanValue').hasError('backendError')">{{propertiesFormGroup?.get(field.id).get('booleanValue').getError('backendError').message}}</mat-error>
|
||||
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('booleanValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
|
|
|
@ -27,7 +27,6 @@ import { Observable } from 'rxjs';
|
|||
import { distinctUntilChanged, takeUntil } from 'rxjs/operators';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
import { DescriptionFormService } from '../services/description-form.service';
|
||||
import { MatCheckboxChange } from '@angular/material/checkbox';
|
||||
|
||||
@Component({
|
||||
selector: 'app-description-form-field',
|
||||
|
@ -269,10 +268,6 @@ export class DescriptionFormFieldComponent extends BaseComponent implements OnIn
|
|||
}
|
||||
}
|
||||
|
||||
checkboxChangeEvent(event: MatCheckboxChange, fieldId: string) {
|
||||
if (!(event?.checked ?? true)) this.propertiesFormGroup?.get(fieldId)?.get('booleanValue')?.reset();
|
||||
}
|
||||
|
||||
onRemove(makeFilesNull: boolean = true) {
|
||||
this.makeFilesNull()
|
||||
this.cdr.detectChanges();
|
||||
|
|
Loading…
Reference in New Issue