mirror of
https://github.com/jlengrand/polymer-array-bubble-up-example.git
synced 2026-03-10 08:41:23 +00:00
37 lines
1.5 KiB
HTML
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> |