I am learning angular2 and trying to implement a scenario where I have a text box in the page. Whenever I type any value to the text box, I want a cancel/remove text to appear to the right and selecting that should clear the entered value of the text box. In my html-
<md-input #productName name="productName" (keydown)="handleKeyDown($event)" type="text" placeholder="Start typing to select product types"></md-input>
I am not able to figure out how should I add and display the cancel text with cross icon upon typing the text. Can someone let me know how should I tweak my handleKeyDown function to achieve that.