25 lines
717 B
TypeScript
25 lines
717 B
TypeScript
import { Field } from '../../models/DataSetProfile/Field';
|
|
import { FormGroup } from '@angular/forms';
|
|
import { Component, Input, OnInit } from '@angular/core';
|
|
|
|
@Component({
|
|
selector: 'combobox-component',
|
|
templateUrl: './combobox-component.html'
|
|
})
|
|
export class ComboboxComponent implements OnInit{
|
|
@Input() dataModel: Field;
|
|
@Input() form: FormGroup;
|
|
type: string;
|
|
options = [{id:"autocomplete", value: "autocomplete"}, {id:"wordlist", value: "wordlist"}];
|
|
|
|
ngOnInit(){
|
|
if (this.dataModel.data){
|
|
this.type = this.form.get("data").get("type").value;
|
|
}
|
|
|
|
}
|
|
|
|
onchangeCombo(){
|
|
if (this.form.get("data")) this.form.removeControl("data");
|
|
}
|
|
} |