Skip to content

Instantly share code, notes, and snippets.

@edsilv
Last active August 29, 2015 14:03
Show Gist options
  • Save edsilv/cd830dc3cbf20df97ab1 to your computer and use it in GitHub Desktop.
Save edsilv/cd830dc3cbf20df97ab1 to your computer and use it in GitHub Desktop.
designer
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-counter" attributes="counter">
<template>
<style>
</style>
<div id="label">
<content></content>
</div>
<span id="counterVal">{{ counter }}</span>
<br></br>
<button id="button" on-tap="{{ increment }}">Increment</button>
</template>
<script>
Polymer('my-counter', {
counter: 0,
counterChanged: function () {
this.$.counterVal.classList.add('highlight');
},
increment: function () {
this.counter++;
}
});
</script>
</polymer-element>
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-counter" attributes="counter">
<template>
<style>
</style>
<div id="label">
<content></content>
</div>
<span id="counterVal">{{ counter }}</span>
<br/>
<button id="button" on-tap="{{ increment }}">Increment</button>
</template>
<script>
Polymer('my-counter', {
counter: 0,
counterChanged: function () {
this.$.counterVal.classList.add('highlight');
},
increment: function () {
this.counter++;
}
});
</script>
</polymer-element>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment