152303aee7ca64e0aceb981b7a65cdee29f8be09
[sdc.git] /
1 import { Component, ViewChild, ElementRef, ContentChildren, Input } from '@angular/core';
2 import { BrowserModule } from '@angular/platform-browser'
3 import { UiElementBase, UiElementBaseInterface } from './../ui-element-base.component';
4
5 @Component({
6   selector: 'ui-element-checkbox',
7   templateUrl: './ui-element-checkbox.component.html',
8   styleUrls: ['./ui-element-checkbox.component.less'],
9 })
10 export class UiElementCheckBoxComponent extends UiElementBase implements UiElementBaseInterface {
11
12   constructor() {
13     super();
14   }
15
16   ngAfterContentInit() {
17     // Convert the value to boolean (instanceOf does not work, the type is undefined).
18     if (this.value==='true' || this.value==='false') {
19       this.value = this.value==='true'?true:false;
20     }
21   }
22
23     onSave() {
24         this.baseEmitter.emit(this.value);
25     }
26
27 }