Created
April 23, 2015 19:58
-
-
Save frankiefu/23fe9b2433f47e797c63 to your computer and use it in GitHub Desktop.
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
<!doctype html> | |
<html> | |
<head> | |
<title></title> | |
<meta charset="utf-8"> | |
<script src="../../components/webcomponentsjs/webcomponents-lite.js"></script> | |
<link rel="import" href="x-app.html"> | |
</head> | |
<body> | |
<x-app> | |
<div>Foo</div> | |
<div>Bar</div> | |
<div>Zot</div> | |
</x-app> | |
<button onclick="test()">test</button> | |
<script> | |
function test() { | |
document.querySelector('x-app').test(); | |
} | |
</script> | |
</body> | |
</html> |
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="../../components/polymer/polymer.html"> | |
<dom-module id="x-app"> | |
<template> | |
<div> | |
<content></content> | |
</div> | |
</template> | |
</dom-module> | |
<script> | |
Polymer({ | |
is: 'x-app', | |
test: function() { | |
var nodes = Polymer.dom(this).childNodes; | |
for (var i = nodes.length - 1; i >= 0; i--) { | |
Polymer.dom(this).removeChild(nodes[i]); | |
} | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment