Skip to content

Instantly share code, notes, and snippets.

@digilord
Created February 24, 2014 20:54
Show Gist options
  • Save digilord/9196826 to your computer and use it in GitHub Desktop.
Save digilord/9196826 to your computer and use it in GitHub Desktop.
<link rel="import" href="../bower_components/polymer/polymer.html">
<polymer-element name="polymer-file-upload" attributes="">
<template>
<style>
/* styles for the custom element itself - lowest specificity */
:host { display: block; }
/*
style if an ancestor has the different class
:host(.different) { }
*/
</style>
<input id="FileUpload" type="file" on-change="{{changeHandler}}">
</template>
<script>
Polymer('polymer-file-upload', {
//applyAuthorStyles: true,
//resetStyleInheritance: true,
changeHandler: function(event){
console.log(event);
},
// element is fully prepared
ready: function(){
var fileUpload = this.$.FileUpload;
},
// instance of the element is created
created: function() { },
// instance was inserted into the document
enteredView: function() { },
// instance was removed from the document
leftView: function() { },
// attribute added, removed or updated
attributeChanged: function(attrName, oldVal, newVal) {
console.log(attrName);
}
});
</script>
</polymer-element>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment