Tuesday, September 15, 2015

Re: JsInterop hello world

@JsNamespace("$wnd.poc")
@JsExport("Hello")
@JsType
public class JsHello {
 
public String sayHello(String name) {
   
return "Hello " + name;
 
}
}



I think the above should work. But there is already a commit pending which introduces new annotations for JsInterop which should make things a bit easier. The above example with new annotations would look like

@JsType(namespace = "poc", name = "Hello", export = true)
public class JsHello {
 
public String sayHello(String name) {
   
return "Hello " + name;
 
}
}


-- J.

--
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 http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment