Last active
November 6, 2015 11:11
-
-
Save kikill95/1b14cd2792961977c09d to your computer and use it in GitHub Desktop.
Kirill G. - little dive into Polymer
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"> | |
<template> | |
<style> | |
/* CSS rules for your element */ | |
</style> | |
<!-- local DOM for your element --> | |
<div>{{greeting}}</div> <!-- data bindings in local DOM --> | |
</template> | |
<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> | |
</dom-module> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment