32 lines
898 B
TypeScript
32 lines
898 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-entry',
|
|
templateUrl: 'entry.html',
|
|
styleUrls: ['entry.less'],
|
|
})
|
|
export class EntryComponent {
|
|
/// Value of the password
|
|
@Input() value: string = '';
|
|
/// Placeholder of the Value
|
|
@Input() placeholder: string = '';
|
|
/// The element has an error
|
|
@Input() hasError: boolean = false;
|
|
/// event when change the value of the password
|
|
@Output() changeValue: EventEmitter<string> = new EventEmitter();
|
|
|
|
/**
|
|
* When input value change, need update the display and change the internal value.
|
|
* @param newValue New value set on the password
|
|
*/
|
|
onChangeValue(newValue: string): void {
|
|
this.value = newValue;
|
|
this.changeValue.emit(this.value);
|
|
}
|
|
}
|