Use an annotation processor
@AutoLiteral
@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
class MyFoo {
public int field1, field2;
}
@Generated(...)
@JsType(IsNative = true, namespace = JsPackage.GLOBAL, name = "Object")
class MyFooLiteral extends MyFoo {
public
> If your concert is to be able to write one-line initializers, and you are
> using java8 syntax you also do something like that:
>
> public static T apply(T t, Consumer fn) {
> fn.accept(t);
> return t;
> }
>
> @JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
>
Thanks Paul. I haven't seen use of the JsOverlay yet, that's nifty.
Nice Ignacio.
On Tue, Mar 22, 2016 at 6:01 AM Paul Stockley wrote:
> That's a nice approach.
>
>
> On Tuesday, March 22, 2016 at 3:25:13 AM UTC-4, Ignacio Baca Moreno-Torres
> wrote:
>>
>> If your concert
That's a nice approach.
On Tuesday, March 22, 2016 at 3:25:13 AM UTC-4, Ignacio Baca Moreno-Torres
wrote:
>
> If your concert is to be able to write one-line initializers, and you are
> using java8 syntax you also do something like that:
>
> public static T apply(T t, Consumer fn) {
>
If your concert is to be able to write one-line initializers, and you are
using java8 syntax you also do something like that:
public static T apply(T t, Consumer fn) {
fn.accept(t);
return t;
}
@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
class
I have come up with 3 approaches to creating object literals given the
current JsInterop capabilities:
*1) Construct and set the fields individually*
@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
class SomeObjectLiteral {
int field1;
String field2;
}
I think having a really succinct way of dealing with JS Object literals
will be key to inter-op with existing java script code. Is the plan to land
the enhanced support in the 2.x code base or will this be j2cl only? I
really hope it will be included on 2.x
In the meantime I have come up with
Thank you! That's awesome.
On Sunday, March 20, 2016 at 12:08:10 AM UTC-7, Ray Cromwell wrote:
>
> Right now, the best you can do is
>
> @JsType(isNative = true, namespace =JsPackage.GLOBAL, name = "Object")
> class MyLiteral {
> }
>
> And put js properties on the object
>
>
> On Sat, Mar
Right now, the best you can do is
@JsType(isNative = true, namespace =JsPackage.GLOBAL, name = "Object")
class MyLiteral {
}
And put js properties on the object
On Sat, Mar 19, 2016 at 11:11 PM, Brandon Donnelson
wrote:
> I found a doc talking about object literal
I found a doc talking about object literal creation
https://docs.google.com/document/d/1DFrC-GtcK7cu6DGxaWCswvb2fai9cnrWPvGcdgsKlBw/edit.
--
You received this message because you are subscribed to the Google Groups "GWT
Contributors" group.
To unsubscribe from this group and stop receiving
10 matches
Mail list logo