JavaScript Integration helpers
Pre-release
Pre-release
New features
- Provide
$elementto template event handlers(click)="$server.clickOnText($element.textContent)- Refers to the element that has the listener, not
$event.target
- Generalize
@EventHandlerfrom Template into a Component feature$servercallbacks available inelement.$serveron the client side@EventHandler public void MyComponent.publishedMethod(int someNumber);on the server defines the method,theElement.$server.publishedMethod(42)on the client invokes the method
- Add
Element.callFunctionfor invoking JavaScript methods on elements- e.g.
myWebComponent.getElement().callFunction("setValue",12)
- e.g.
Fixes
- Throw an exception if arrays are used in a Template Model
- Ensure assertion errors are not shown as empty messages
- Fix unclear error message for
@EventHandlermethod with non-void return type - Don't include
<script>from Template into pre-render HTML
Demos
No changes