HI!  I've created a <custom-pager> element which dynamically creates 
polymer-element instances on the fly (instead of having to preload 
elements.)  Ex (note, this is concept only, probably has bugs):

<polymer-element name="my-page1" attributes="attr1" noscript>
<template>
Page1 {{attr1}}
</template>
</polymer-element>

<polymer-element name="my-page2" attributes="attr2" noscript>
<template>
Page 2 {{attr2}}
</template>
</polymer-element>


<polymer-element name="custom-pager">
<template></template>
<script>
Polymer({
 changePage(elementname, attrs) {
  //...other code
  var div = document.createElement('div');
  div.innerHTML = '<' + elementname + '></' + elementname + '>';
  for(var k in attrs) {
   div.children[0][k] = attrs[k];
  }
  this.appendChild(div);
 }
});
</script>
</polymer-element>


<custom-pager></custom-pager>
<script>
window.addEventListener('polymer-ready', function() {
 document.querySelector('custom-pager').changePage('my-page1', {attr1: 
'{{boundvarfromelsewheredotcom}}'});
});
</script>

The issue is, i dont know which attributes the developer, using my 
custom-pager, needs to be passed + bound into the page "my-page1".  

Question is, is there a way to have custom-pager automagically bind to all 
attributes so that they can be passed on to the pages (so one could specify 
<custom-pager attr1="{{attr1value}}" attr2="{{attr2value}}"/> )?  Or is 
there a way to publish the attribute (per element instance, not prototype) 
on-the-fly (which would look like <custom-pager attr1="{{attr1value}}" 
attr2="{{attr2value}}" bindToAttributes="attr1 attr2"/> )?

Thanks peeps!

p4

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/c649f93b-e859-4c07-8735-1c89c6fc0882%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to