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({
|
|
|
|
selector: 'framadate-erasable-input',
|
|
|
|
templateUrl: './erasable-input.component.html',
|
2020-04-14 11:28:33 +02:00
|
|
|
styleUrls: ['./erasable-input.component.scss'],
|
2020-01-16 14:37:11 +01:00
|
|
|
})
|
|
|
|
export class ErasableInputComponent implements OnInit {
|
|
|
|
@Output() inputModelChange = new EventEmitter();
|
|
|
|
|
2020-01-21 12:30:53 +01:00
|
|
|
@Input() inputModel;
|
2020-01-16 14:37:11 +01:00
|
|
|
|
2020-04-14 11:28:33 +02:00
|
|
|
constructor() {}
|
2020-01-16 14:37:11 +01:00
|
|
|
|
2020-04-14 11:28:33 +02:00
|
|
|
ngOnInit() {}
|
2020-01-16 14:37:11 +01:00
|
|
|
|
|
|
|
eraseInput() {
|
2020-01-21 12:30:53 +01:00
|
|
|
//
|
2020-01-20 15:15:06 +01:00
|
|
|
this.inputModelChange.emit('');
|
2020-01-22 11:18:55 +01:00
|
|
|
// TODO focus on other element
|
2020-01-16 14:37:11 +01:00
|
|
|
}
|
|
|
|
}
|