Skip to content
This repository has been archived by the owner on Jan 4, 2021. It is now read-only.

How to get the current value of the widget? #2

Closed
notgiorgi opened this issue Sep 18, 2017 · 3 comments
Closed

How to get the current value of the widget? #2

notgiorgi opened this issue Sep 18, 2017 · 3 comments

Comments

@notgiorgi
Copy link

notgiorgi commented Sep 18, 2017

I want to capture the current value (result) of the widget.

I attached the event listener to myscript-text-web-result but the docs say nothing about the object it passes as argument in the callback.

I guess event.detail.result.textSegmentResult.candidates[0].label is the whole result right?

@padewitte
Copy link
Contributor

Yes you are right. event.detail.result.textSegmentResult.candidates is an array containing all the candidates from the recognition engine. We will improve deeply the documentation in the upcoming version. We will address your remark.

The other option is to read the value of the firstcandidate attribute.

@notgiorgi
Copy link
Author

notgiorgi commented Sep 18, 2017

We will improve deeply the documentation in the upcoming version

That would be great

The other option is to read the value of the firstcandidate attribute.

just found that, thanks.

@notgiorgi
Copy link
Author

Also the web demo is not working: https://myscript.github.io/myscript-text-web/components/myscript-text-web/#myscript-text-web:event-myscript-text-web-result

RomainCscn added a commit that referenced this issue Feb 19, 2018
…readme to master

* commit '4525e2e51a5432fcff870fe7fcee63e9f89a00d8':
  [FIX] Remove pep from readme
  [DOCS] Update Readme
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants