Last active
August 29, 2015 14:05
-
-
Save aslakknutsen/2a5c78fe5210a20814ec to your computer and use it in GitHub Desktop.
LiveOak Polymer Web Components
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="charts.html" /> | |
<link rel="import" | |
href="liveoak.html" /> | |
<polymer-element name="liveoak-demo"> | |
<template> | |
<liveoak-config clientid="xyz" realm="my-app" /> | |
<liveoak-authenticate> | |
<div not-authenticated> | |
<button>Login</button> | |
</div> | |
<div authenticated> | |
<img /> | |
</div> | |
</liveoak-authenticate> | |
<liveoak-authorized role="admin"> | |
<liveoak-storage | |
location="storage/my-data" | |
response="{{data}}" | |
subscribe="{{updateCart}}"/> | |
<my-chart id="chart" data="{{data}}" /> | |
</liveoak-authorized> | |
</template> | |
<script> | |
Polymer('liveoak-demo', { | |
updateChart: function(data) { | |
this.$.chart.add(data); | |
} | |
}); | |
</script> | |
</polymer-element> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment