Sadaf Shafi
Sadaf Shafi

Reputation: 1458

Selecting text in ionic should trigger an event ? how?

Well it has been done in JS, and I did it on the web version of my app using JS How do I do same for android app. What I essentially want is that I'd select text in my ionic app, and when I do so, I'd expect to get an option of 'Highlight' the text , and then the text gets saved in a variable which I can use further Essentially it is a note taking app, where I highlight the text I did it using TinyQ in js, but how to do it in ionic All the efforts are appretiated

Upvotes: 0

Views: 262

Answers (1)

Najam Us Saqib
Najam Us Saqib

Reputation: 3402

To get Selected text you can use:

window.getSelection().toString()

Check Working Stackblitz:

Upvotes: 1

Related Questions