summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/components/dynamic-element/elements-ui/dropdown/ui-element-dropdown.component.ts
blob: b1fb37a186120dd2e66db59155c1a77d087b54c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { Component, EventEmitter, Output, Input } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { UiElementBase, UiElementBaseInterface } from './../ui-element-base.component';

export class DropdownValue {
  value:string;
  label:string;

  constructor(value:string,label:string) {
    this.value = value;
    this.label = label;
  }
}

@Component({
  selector: 'ui-element-dropdown',
  templateUrl: './ui-element-dropdown.component.html',
  styleUrls: ['./ui-element-dropdown.component.less'],
})
export class UiElementDropDownComponent extends UiElementBase implements UiElementBaseInterface {
  @Input()
  values: DropdownValue[];

  constructor() {
    super();
  }

    onSave() {
        this.baseEmitter.emit(JSON.parse(this.value));
    }

}