Created
September 17, 2013 17:29
-
-
Save sorvell/6597649 to your computer and use it in GitHub Desktop.
SD polyfill nested content distribution failure
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
<!-- <script src="http://polymer-project.org/polymer.min.js"></script> --> | |
<script src="../../../polymer/polymer.js"></script> | |
<template> | |
<h1>Foo</h1> | |
<div> <div><content></content></div></div> | |
</template> | |
<template id="two"> | |
<h1>Bar</h1> | |
<div> | |
<content></content> | |
</div> | |
</template> | |
<x-foo> | |
<p>Nested content</p> | |
</x-foo> | |
<x-bar> | |
<p>Content</p> | |
</x-bar> | |
<script> | |
document.addEventListener('DOMContentLoaded', function() { | |
var xfoo = document.querySelector('x-foo'); | |
var dom = document.querySelector('template').content.cloneNode(true); | |
xfoo.createShadowRoot().appendChild(dom); | |
var xbar = document.querySelector('x-bar'); | |
dom = document.querySelector('template#two').content.cloneNode(true); | |
xbar.createShadowRoot().appendChild(dom); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment