30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
|
import { Component, Input, OnInit } from '@angular/core';
|
|||
|
import { FormGroup } from '@angular/forms';
|
|||
|
import { DatasetProfileComboBoxType } from '../../../../../../../core/common/enum/dataset-profile-combo-box-type';
|
|||
|
import { EnumUtils } from '../../../../../../../core/services/utilities/enum-utils.service';
|
|||
|
import { takeUntil } from 'rxjs/operators';
|
|||
|
import { BaseComponent } from '../../../../../../../core/common/base/base.component';
|
|||
|
|
|||
|
@Component({
|
|||
|
selector: 'app-dataset-profile-editor-combo-box-field-component',
|
|||
|
styleUrls: ['./dataset-profile-editor-combo-box-field.component.scss'],
|
|||
|
templateUrl: './dataset-profile-editor-combo-box-field.component.html'
|
|||
|
})
|
|||
|
export class DatasetProfileEditorComboBoxFieldComponent extends BaseComponent implements OnInit {
|
|||
|
|
|||
|
@Input() form: FormGroup;
|
|||
|
options = DatasetProfileComboBoxType;
|
|||
|
|
|||
|
constructor(
|
|||
|
public enumUtils: EnumUtils
|
|||
|
) { super(); }
|
|||
|
|
|||
|
ngOnInit() {
|
|||
|
this.form.get('data').get('type').valueChanges
|
|||
|
.pipe(takeUntil(this._destroyed))
|
|||
|
.subscribe(x => {
|
|||
|
if (this.form.get('data')) { this.form.removeControl('data'); }
|
|||
|
})
|
|||
|
}
|
|||
|
}
|