I have a dropdown that works just fine. If user selects an option and then presses the **"Delete"** Or **"Backspace"** button from keyboard the value from the dropdown will clear (**this works great**). However, I'm trying to create a **Directive** that will do the same thing, but I can't get it to work. Can anyone point me in the right direction on how to properly create this directive? 

Thanks a lot in advance!

Here's my code:

[**LIVE DEMO**](https://stackblitz.com/edit/primeng-dropdown-automation-osjiwr?file=app%2Fapp.component.ts)

```
onKeyUp(evt){
   if(evt.keyCode === 8){
     this.isShowClear = false;
     let currentElementName = evt.currentTarget.getAttribute('name');
     this.myForm.controls[currentElementName].patchValue('');
 }
}

onChange(){
this.isShowClear = true;
}

```