/** @file * @author Edouard DUPIN * @copyright 2018, Edouard DUPIN, all right reserved * @license PROPRIETARY (see license file) */ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; @Component({ selector: 'app-entry', templateUrl: 'entry.html', styleUrls: ['entry.less'], }) export class EntryComponent implements OnInit { /// Value of the password @Input() value: string|undefined = ''; /// Placeholder of the Value @Input() placeholder: string|undefined = ''; /// The element has an error @Input() hasError: boolean = false; /// event when change the value of the password @Output() changeValue: EventEmitter = new EventEmitter(); ngOnInit(): void { //if (value) } /** * 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); } }