2020-04-14 11:28:33 +02:00
|
|
|
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
2020-01-16 14:37:11 +01:00
|
|
|
|
|
|
|
@Component({
|
2020-04-22 12:56:18 +02:00
|
|
|
selector: 'app-erasable-input',
|
2020-04-21 10:50:26 +02:00
|
|
|
templateUrl: './erasable-input.component.html',
|
|
|
|
styleUrls: ['./erasable-input.component.scss'],
|
2020-01-16 14:37:11 +01:00
|
|
|
})
|
|
|
|
export class ErasableInputComponent implements OnInit {
|
2020-04-21 10:50:26 +02:00
|
|
|
@Output() inputModelChange = new EventEmitter();
|
2020-01-16 14:37:11 +01:00
|
|
|
|
2020-04-21 10:50:26 +02:00
|
|
|
@Input() inputModel;
|
2020-01-16 14:37:11 +01:00
|
|
|
|
2020-04-21 10:50:26 +02:00
|
|
|
constructor() {}
|
2020-01-16 14:37:11 +01:00
|
|
|
|
2020-05-01 19:10:17 +02:00
|
|
|
ngOnInit(): void {}
|
2020-01-16 14:37:11 +01:00
|
|
|
|
2020-04-21 10:50:26 +02:00
|
|
|
eraseInput() {
|
|
|
|
//
|
|
|
|
this.inputModelChange.emit('');
|
|
|
|
// TODO focus on other element
|
|
|
|
}
|
2020-01-16 14:37:11 +01:00
|
|
|
}
|