Created
May 12, 2015 10:38
-
-
Save metalmatze/ce4347a3a44a5520c2f2 to your computer and use it in GitHub Desktop.
Polymer element
This file contains 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
<dom-module id="element-name"> | |
<style> | |
/* CSS rules for your element */ | |
</style> | |
<template> | |
<!-- local DOM for your element --> | |
<div>{{greeting}}</div> <!-- data bindings in local DOM --> | |
</template> | |
</dom-module> | |
<script> | |
// element registration | |
Polymer({ | |
is: "element-name", | |
// add properties and methods on the element's prototype | |
properties: { | |
// declare properties for the element's public API | |
greeting: { | |
type: String, | |
value: "Hello!" | |
} | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment