Files
polymer-array-bubble-up-exa…/app/index.html
julien Lengrand-Lambert 456e135be4 Trying stuff
2017-08-16 22:04:33 +02:00

37 lines
1.5 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>An example of how to *not* have items update an array in Polymer</title>
</head>
<script src="webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="components/example-component/example-component.html">
<body>
<example-component></example-component>
<script>
document.querySelector('example-component').addEventListener('kick', function (e) {
console.log("fired");
console.log(e.kicked); // true
this.notifyPath('element');
this.notifyPath('element.person');
this.notifyPath('elements');
});
// var el = document.querySelector('example-component');
// el.addEventListener('kick', function(){
// var normalizedEvent = Polymer.dom(event);
// // logs #myButton
// console.info('rootTarget is:', normalizedEvent.rootTarget);
// // logs the instance of event-targeting that hosts #myButton
// console.info('localTarget is:', normalizedEvent.localTarget);
// // logs [#myButton, document-fragment, event-retargeting,
// // body, html, document, Window]
// console.info('path is:', normalizedEvent.path);
// });
</script>
</body>
</html>