argos/dmp-frontend/src/app/form/dynamic-fields/dynamic-field-checkbox/dynamic-field-checkbox.ts

22 lines
584 B
TypeScript
Raw Normal View History

2017-11-27 14:40:16 +01:00
import { Field } from '../../../models/Field';
import { FormGroup } from '@angular/forms';
2018-05-14 08:44:35 +02:00
import { Component, Input, ViewEncapsulation, OnInit } from '@angular/core';
2017-11-27 14:40:16 +01:00
@Component({
2018-10-05 17:00:54 +02:00
selector: 'app-df-checkbox',
templateUrl: './dynamic-field-checkbox.html',
styleUrls: [
'./dynamic-field-checkbox.css'
],
encapsulation: ViewEncapsulation.None
2017-11-27 14:40:16 +01:00
})
export class DynamicFieldCheckBoxComponent implements OnInit {
2018-10-05 17:00:54 +02:00
@Input() field: Field;
@Input() form: FormGroup;
2017-12-06 12:39:49 +01:00
ngOnInit(): void {
if (this.form.get('value').value === null) { this.form.get('value').patchValue(false); }
}
2018-05-28 11:50:42 +02:00
}