Photo by Kelly Sikkema on Unsplash

Recently I had to handle the pasting and manipulating data, in one of our Angular projects. We are using Angular 11 and Typescript of course. The nice part is that almost 100% of the solution is irrelevant to Angular and is solely based on DOM events and JS. So, I thought that it would be nice to share.

At first we have to bind our method with the “paste” listener in our textarea component. We have a custom component for <textarea>, but the binding is the same also in the standard html tag.

--

--

Theodoros Mathioudakis

Theodoros Mathioudakis

Software engineer. Passionately curious. Track and Field. Greece.