Anything different about dom-bind and custom events?

46 views
Skip to first unread message

geriatric...@gmail.com

unread,
Jul 3, 2015, 4:35:01 PM7/3/15
to polym...@googlegroups.com
Is there anything special about a dom-bind template and receiving custom events?

For instance my default index.html looks like
<template is="dom-bind" id="app">

   
<iron-pages selected="0">
     
<div>one</div>
     
<div>
     
<smartbuzz-app on-hasGroupOrTarget="{{gort}}"></smartbuzz-app>
     
</div>
   
</iron-pages>
   
 
</template>
 
<!-- build:js scripts/app.js -->
 
<script src="scripts/app.js"></script>
 
<!-- endbuild-->

In the app.js
var app = document.querySelector('#app');
  app
.gort = function(){
     console
.log('caught fire');
     
var pages = document.querySelector('iron-pages');
      pages
.selectNext();
 
}

And fired in the <smartbuzz-app>
ready: function(){      
     
        console
.log('fired');
       
this.fire('hasGroupOrTarget');
     
   
},

Perhaps I have the on-hasGroupOrTarget="{{gort}} wrong?

Thanks for your time

geriatric...@gmail.com

unread,
Jul 3, 2015, 5:10:52 PM7/3/15
to polym...@googlegroups.com, geriatric...@gmail.com
Ok it appears that the captialization on the event name was the problem: I set it all to lowercase.
Also the proper syntax is
<smartbuzz-app on-hasgrouportarget="gort"></smartbuzz-app>
without double moustache


Now I have to deal with loading order: It appears children.ready happens before parent-WebComponentsReady and parent-dom-change. I can work around that.
Reply all
Reply to author
Forward
0 new messages