Created
June 25, 2014 13:20
-
-
Save C-F-K/8aeb4d15c0acd5d5d3ee to your computer and use it in GitHub Desktop.
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
<link rel="import" href="../../bower_components/polymer/polymer.html"> | |
<link rel="import" href="../../bower_components/firebase-element/firebase-element.html"> | |
<polymer-element name="db-save"> | |
<template> | |
<firebase-element id="db" | |
location="http://cth-storage.firebaseio.com/" | |
data="{{data}}" | |
keys="{{keys}}" | |
childEvents | |
log> | |
</firebase-element> | |
</template> | |
<script> | |
Polymer('db-save', { | |
publish: { | |
combinedvote: {} | |
}, | |
didThing: 0, | |
combinedvoteChanged: function(){ | |
if (!this.didThing) { | |
var user = this.combinedvote.userId; | |
this.data[user] = this.combinedvote; | |
this.$.db.commit(); | |
this.didThing = 1; | |
} | |
} | |
}); | |
</script> | |
</polymer-element> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment