We have an example of that you can look at in Errai Tutorial. Here is a JS interop wrapper for an anchor element that supports data-binding to its href property.
Key things to note:
- The @Element("a") makes this injectable (satisfied by an anchor tag).
- It implements a special HasValue interface for native JS types.
- Any @Bound @JsType implementing this HasValue interface will use the HasValue methods for data-binding operations.
- Not implement the HasValue methods and use @JsProperty so that calls to getValue and setValue are compiled to property accesses and assignments.
Why does the class need to be abstract?