Skip to content

Instantly share code, notes, and snippets.

@secretrobotron
Last active December 28, 2015 19:19
Show Gist options
  • Save secretrobotron/7549447 to your computer and use it in GitHub Desktop.
Save secretrobotron/7549447 to your computer and use it in GitHub Desktop.
Polymer ceci example
<polymer-element name="ceci-button" attributes="label"
extends="ceci-element" label="Click Me">
<template>
<style>
:host {
display: block;
width: 100%;
}
</style>
<button id="button" on-click="{{onClick}}">
{{label}}
</button>
</template>
<script>
Polymer('ceci-example', {
ready: function () {
this.super();
},
onClick: function () {
this.broadcast('click');
},
ceci: {
defaultBroadcasts: ['click'],
broadcasts: {
click: 'Fired when button is clicked.'
},
listeners: {
setLabel: 'Set Label'
},
editable: {
'label': {
type: "text",
description: "Text shown on the button.",
name: 'Label'
},
}
}
});
</script>
</polymer-element>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment