I'll try to find some time next week for uploading examples on my github
account.

A simple example could be:

package elemental.sample.simple;

import static elemental2.Global.alert;
import static elemental2.Global.document;

import com.google.gwt.core.client.EntryPoint;

import elemental2.Event;
import elemental2.EventListener;
import elemental2.HTMLButtonElement;

public class SimpleApp implements EntryPoint{
  public void onModuleLoad() {
    final HTMLButtonElement button = (HTMLButtonElement)
document.createElement("button");
    button.textContent = "Click me";
    button.addEventListener(
        "click",
        new EventListener() {
          @Override
          public void handleEvent(Event evt) {
            button.parentNode.removeChild(button);
            alert("Button has been removed.");
          }
        });
    document.body.appendChild(button);
  }
}

Elemental2.Global can be considered as the entry point of the library. It
gathers all methods/fields available from the global scope (but not the
window API).

On Thu, Jun 30, 2016 at 12:15 PM Matic Petek <[email protected]> wrote:

> Hi,
>   I would be nice If you could publish simple example how to start using
> it.
> Regards,
>    Matic
>
> On Thursday, June 30, 2016 at 2:23:51 AM UTC+2, Julien Dramaix wrote:
>>
>> A new experimental version of Elemental2 using the new JsInterop
>> specification has been pushed on Sonatype today.
>>
>> You can try it by downloading the jar file
>> <https://oss.sonatype.org/service/local/repositories/google-releases/content/com/google/gwt/elemental2-experimental/16-06-30/elemental2-experimental-16-06-30.jar>
>> or adding this following maven dependency:
>>
>> <dependency>
>>
>>  <groupId>com.google.gwt</groupId>
>>
>>  <artifactId>elemental2-experimental</artifactId>
>>
>>  <version>16-06-30</version>
>>
>> </dependency>
>>
>> Then, inherits the elemental2 module:
>>
>> <inherits name="elemental2" />
>>
>> This experimental version works only with the last 2.8-snapshot release
>> of GWT.
>>
>> The goal of this release is to get feedback so don’t hesitate to report
>> any bugs, issues, concerns you have on this mailing list.
>>
>>
>> Important note: This is an experimental release and without doubt the
>> future updates until the final release are going to break code!
>>
>> - Julien
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "GWT Contributors" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/01963a7c-7972-4fd9-88ef-629d0a7bcbac%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/01963a7c-7972-4fd9-88ef-629d0a7bcbac%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CABb_3%3D5M5DQS--awYZ1bS8nHBu9po8Ne8JPY_ianrUjNZrSqyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to