Skip to content

Instantly share code, notes, and snippets.

@danialgoodwin
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danialgoodwin/d5197126bde464c62ac0 to your computer and use it in GitHub Desktop.
Save danialgoodwin/d5197126bde464c62ac0 to your computer and use it in GitHub Desktop.
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/core-ajax/core-ajax.html">
<polymer-element name="my-element" noscript>
<template>
<span>I'm <b>my-element</b>. This is my Shadow DOM.</span>
<core-ajax url="http://example.com/json" auto response="{{resp}}"></core-ajax>
<textarea value="{{resp}}"></textarea>
</template>
</polymer-element>
<link rel="import" href="../bower_components/polymer/polymer.html">
<polymer-element name="my-element" noscript>
<template>
<span>Hello from <b>my-element</b>. This is my Shadow DOM.</span>
</template>
</polymer-element>
<!DOCTYPE html>
<html>
<head>
<!-- 1. Load platform support before any code that touches the DOM. -->
<script src="bower_components/webcomponentsjs/webcomponents.min.js"></script>
<!-- 2. Load the component using an HTML Import -->
<link rel="import" href="elements/my-element.html">
</head>
<body>
<!-- 3. Declare the element by its tag. -->
<my-element></my-element>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment