970c61531f5e2f9513b14af30f2038d4bff0cd2b
[sdc.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 import { Component, EventEmitter, Output, Input } from '@angular/core'
22 import { BrowserModule } from '@angular/platform-browser'
23 import { UiElementBase, UiElementBaseInterface } from './../ui-element-base.component';
24
25 export class DropdownValue {
26   value:string;
27   label:string;
28
29   constructor(value:string,label:string) {
30     this.value = value;
31     this.label = label;
32   }
33 }
34
35 @Component({
36   selector: 'ui-element-dropdown',
37   templateUrl: './ui-element-dropdown.component.html',
38   styleUrls: ['./ui-element-dropdown.component.less'],
39 })
40 export class UiElementDropDownComponent extends UiElementBase implements UiElementBaseInterface {
41   @Input()
42   values: DropdownValue[];
43
44   constructor() {
45     super();
46   }
47
48     onSave() {
49         this.baseEmitter.emit(JSON.parse(this.value));
50     }
51
52 }