30 lines
837 B
TypeScript
30 lines
837 B
TypeScript
/** @file
|
|
* @author Edouard DUPIN
|
|
* @copyright 2018, Edouard DUPIN, all right reserved
|
|
* @license PROPRIETARY (see license file)
|
|
*/
|
|
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
|
|
@Component({
|
|
selector: 'app-checkbox',
|
|
templateUrl: 'checkbox.html',
|
|
styleUrls: ['checkbox.less'],
|
|
})
|
|
export class CheckboxComponent {
|
|
/// Checkbox value
|
|
@Input() value: boolean = false;
|
|
/// Description of the checkbox
|
|
@Input() comment: string = "";
|
|
/// event when change the value of the password
|
|
@Output() changeValue: EventEmitter<boolean> = new EventEmitter();
|
|
|
|
/**
|
|
* When input value change, need update the display and change the internal value.
|
|
* @param newValue New value set on the password
|
|
*/
|
|
onChange(newValue: boolean): void {
|
|
this.value = newValue;
|
|
this.changeValue.emit(this.value);
|
|
}
|
|
}
|