[SDC-29] rebase continue work to align source
[sdc.git] / catalog-ui / src / app / ng2 / components / dynamic-element / elements-ui / ui-element-base.component.ts
1 import { Component, EventEmitter, Input, Output } from '@angular/core'
2 import { ValidationConfiguration } from "app/models";
3 import { FormControl, Validators } from '@angular/forms';
4
5 export interface UiElementBaseInterface {
6     onSave();
7 }
8
9 @Component({
10     template: ``,
11     styles: []
12 })
13 export class UiElementBase {
14
15     protected validation = ValidationConfiguration.validation;
16     protected control: FormControl;
17
18     // Two way binding for value (need to write the "Change" word like this)
19     @Output('valueChange') baseEmitter: EventEmitter<string> = new EventEmitter<any>();
20     @Input('value') set setValueValue(value) {
21         this.value = value;
22     }
23
24     protected name: string;
25     protected type: string;
26     protected value: any;
27     protected pattern: any;
28     protected readonly:boolean;
29
30     constructor() {
31         //this.control = new FormControl('', [Validators.required]);
32         this.control = new FormControl('', []);
33     }
34
35 }