Skip to content

Instantly share code, notes, and snippets.

@tpmccallum
Created November 20, 2014 06:44
Show Gist options
  • Save tpmccallum/2a6bc5ef4664dc3ccde5 to your computer and use it in GitHub Desktop.
Save tpmccallum/2a6bc5ef4664dc3ccde5 to your computer and use it in GitHub Desktop.
<polymer-element name="my-element-wikipedia">
<template>
<style>h2 { color: black; } </style>
<button on-click="{{buttonClick}}"><h2>Hello from my prototyped element!</h2></button>
</template>
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src='http://okfnlabs.org/wikipediajs/wikipedia.js'></script>
<script>
Polymer('my-element-wikipedia', {
buttonClick: function() {
var info = WIKIPEDIA.getData('http://en.wikipedia.org/wiki/Invasion_of_Normandy');
alert(info.summary.title);
console.log(info);
}
});
</script>
</polymer-element>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment