mirror of
https://github.com/jlengrand/polymer-array-bubble-up-example.git
synced 2026-03-10 08:41:23 +00:00
Trying stuff
This commit is contained in:
@@ -27,6 +27,8 @@
|
||||
|
||||
_changeName: function(){
|
||||
console.log("changing name");
|
||||
// this.dispatchEvent(new CustomEvent('kick', {detail: {kicked: true}}));
|
||||
this.fire('kick', {kicked: true});
|
||||
this.set('element.person', {"name": "bobby"});
|
||||
this.notifyPath('element');
|
||||
this.notifyPath('element.person');
|
||||
|
||||
@@ -31,5 +31,5 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
</dom-module>
|
||||
@@ -10,5 +10,28 @@
|
||||
|
||||
<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>
|
||||
Reference in New Issue
Block a user