Skip to content

Instantly share code, notes, and snippets.

@enjikaka
Created August 6, 2017 17:24
Show Gist options
  • Select an option

  • Save enjikaka/923e79fc8ddf280dabdb2d2dfddcbfa8 to your computer and use it in GitHub Desktop.

Select an option

Save enjikaka/923e79fc8ddf280dabdb2d2dfddcbfa8 to your computer and use it in GitHub Desktop.
<link rel="import" href="template-component.html">
<script>
class HomePage extends TemplateComponent {
constructor() {
super(HomePage.is);
}
static get is() {
return 'hello-world';
}
async getState() {
return await fetch('https://api.saoirse.audio/track/tidal/66522953')
.then(res => res.json());
}
}
window.customElements.define(HomePage.is, HomePage);
</script>
<template>
<style>
/* This is scoped! */
p {
color: blue;
font-weight: bold;
}
</style>
<h1>Welcome!</h1>
<p>Awesome song is ${this.tidal_id}</p>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment