Trying to get data on magnetic card swipe in browser in seperate channel angular

I have a magnetic stripe on swipe of the card from my browser it loads the data into my input box field or wherever the focus is present in the window. Instead I need this data as an event to my angular application

Any idea on this how we can get the data as an event from javascript or angular application