Web components and template event handlers
Pre-release
Pre-release
New features
- Server side event handlers for template, e.g.:
(click)="$server.myMethod(input.value);"
- Support for HTML imports through
Page.addHtmlImport()
- Support for defining dependency imports
@StyleSheet
,@JavaScript
or@HtmlImport
- Support for Polymer DOM operations through
Polymer.DOM
when Polymer is loaded - Support for setting inline styles using
Element.setAttribute("style","...");
- Attach events have an
isInitialAttach
method which can be used to react only to the first attach event - Attach events have an
getUI()
andgetSession()
helpers to provide easier access to the UI and Session - Updated API for all HTML components to use correct default values and return
Optional<T>
for attributes which are not always present
Fixes
Template.getParent()
returns the parent instead of always throwing an exception- ThreadLocals are no longer inheritable to avoid referring to the wrong UI in background threads and to prevent memory leaks
Demos
- Hello world using templates update to use server side template event handlers Java HTML
- Integration demo of the Progress Bubble web component Java
New tutorials
- Basic Integration of a Polymer Web Component
- Using Attributes and Properties with a Polymer Web Component
- Using Events with a Polymer Web Component
- Handling User Events in a Template