Skip to content

Instantly share code, notes, and snippets.

@nicholaswmin
Last active April 24, 2016 08:15
Show Gist options
  • Save nicholaswmin/48345a31e9254a78ece039ae71086d8d to your computer and use it in GitHub Desktop.
Save nicholaswmin/48345a31e9254a78ece039ae71086d8d to your computer and use it in GitHub Desktop.
Polymer element using ES6
<base href="https://polygit.org/components/">
<script src="webcomponentsjs/webcomponents-lite.min.js"></script>
<link href="polymer/polymer.html" rel="import">
<link href="paper-input/paper-input.html" rel="import">
<dom-module id="x-example">
<template>
<paper-input value="{{name::input}}"></paper-input>
<h4>{{name}}</h4>
</template>
<script>
"use strict";
class xExample {
beforeRegister() {
this.is = "x-example";
this.properties = {
name: {
type: String,
value: "I'm a data-binded prop"
}
}
}
ready() {
console.log("ready");
}
}
Polymer(xExample);
</script>
</dom-module>
<x-example></x-example>
@nicholaswmin
Copy link
Author

nicholaswmin commented Apr 18, 2016

JSFiddle for the above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment