New features
- Template model with support for basic types:
boolean
,int
,double
,String
public class MyTemplate extends Template {
public interface MyModel extends TemplateModel {
public void setHelloText(String helloText);
public String getHelloText();
}
@Override
public MyModel getModel() {
return (MyModel) super.getModel();
}
}
- Including a template in another template, e.g.
<div>@include path/file.html@</div>
- Support for inline
<script>
and<style>
in templates - Class name bindings in templates, e.g.
<div [class.myclass]="myClassEnabled"></div>
public interface MyModel extends TemplateModel {
public boolean isMyClassEnabled();
}
- Mapping template elements to components using id, e.g.
<paper-slider id="myslider">
@Id("myslider")
private PaperSlider mySlider;
- Mapping an element to a
Component
usingComponent.from(Element)
- More basic components wrapping HTML elements:
Emphasis
,H1
,H2
,H3
,H4
,H5
,H6
,Span
- Support for using most
Element
features with template elements- Element properties
- Synchronized properties
- DOM event listeners
Element.getOuterHtml
to return the outer HTML for an element- Support for
boolean
andint
type properties inPropertyDescriptor
- Support for sending Json values from the client to the server
Fixes
- Correctly detect loading of CSS files in Safari again
Resolver.resolve
andRouterConfiguration.resolveRoute
returnOptional
instead ofnull
- Propert handling of
@EventHandling
methods with varargs - Hello world session size reduced from 9.23KB to 5.97KB
RouterLink
now has a getter forhref
PropertyDescriptor
can be used with anyElement
- An unresolvable route now returns 404 to the browser
- Replaced LGPL
CSS Parser
library with Apache 2ph-css
Demos
- Web site demo updated to use template class bindings Java HTML
- Hello world using templates updated to use template model Java HTML
Tutorials
- Creating A Simple Component Using the Template API
- Binding Class Names in a Template
- Using API Helpers for Defining Component Properties
- Handling User Events in a Template