Created
May 24, 2014 18:28
-
-
Save C-F-K/ccc1b2482304a1776b36 to your computer and use it in GitHub Desktop.
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
<link rel="import" href="../bower_components/polymer/polymer.html"> | |
<link rel="import" href="../bower_components/core-firebase/core-firebase.html"> | |
<polymer-element name="discount-room"> | |
<template> | |
<core-firebase location="https://discount-app.firebaseio.com/" | |
list="{{discount}}" | |
on-items-added={{update}}> | |
<input id="uchar" type="text"></input> | |
<button id="submit" on-click={{sendChar}}>Submit</button> | |
<hr> | |
<pre id="display"></pre> | |
</template> | |
<script> | |
Polymer('discount-room', { | |
ready: function (){ | |
console.log(this.discount); | |
}, | |
sendChar: function sendChar(){ | |
console.log(this.discount); | |
chr = this.$.uchar.value; | |
this.discount.push({uchar: chr, posx: 0, posy: 0}); | |
console.log(this.discount); | |
}, | |
update: function update(){ | |
this.$.display.innerHTML = JSON.stringify(this.discount); | |
} | |
}); | |
</script> | |
</polymer-element> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment