Saturday, May 14, 2016

Importing javascript functions to GWT using JSInteropr?

Is it possible to import the API of a javascript library to GWT using JsInterop?

E.g, stripe.js has methods such as: Stripe.card.validateCardNumber(number) which takes a string, and takes a boolean.

I have a feeling that it should be possible to import this function using @JsMethod perhaps, but I'm not sure of the exact syntax. The specs doc is a little bit lacking in examples.

I'm using 2.8.0-beta1 

Question 2: What if a javascript API performs some async function, and requires a callback to be passed in which contains the result of the operation. Is that possible to handle using JsInterop?

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment