Hi *,
I wanne do something like this:
<dom-module id="hello-world">
<template>
<div>
<paper-input id="inputId" value="{{userInput}}"></paper-input>
<button id="helloButton" on-click="sayHello">Say hello</button>
<div id="greeting">[[greeting]
]</div>
</div>
</template>
<script>
class HelloWorld extends Polymer.Element {
static get is() {
return 'hello-world'
}
sayHello() {
doSomething();
sayHelloIntern();
doSomethingElse();
}
}
customElements.define(HelloWorld.is, HelloWorld);
</script>
</dom-module>
Java:
@Tag("hello-world")
@HtmlImport("/src/HelloWorld.html")
public class HelloWorld extends PolymerTemplate<HelloWorldModel> {
private static final String EMPTY_NAME_GREETING = "Please enter your name";
/**
* Creates the hello world template.
*/
public HelloWorld() {
setId("template");
getModel().setGreeting(EMPTY_NAME_GREETING);
}
@EventHandler
private void sayHelloIntern() {
doMoreStuff();
}
}
Is this possible?