Last active
December 28, 2015 19:19
-
-
Save secretrobotron/7549447 to your computer and use it in GitHub Desktop.
Polymer ceci example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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