-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Polymer.Templatize issues. #4458
Comments
It looks like both The @kevinpschaaf or @sorvell, I'm not sure exactly what |
Same behavior since Polymer 2.0, I have to reset the properties on the instance, see https://github.com/RoXuS/paper-datatable-api/blob/2.0-preview/src/paper-datatable-api-column.js#L119. 👍 |
Sorry for the delay on this. We definitely still need to update the docs here:
|
After looking back at the code, seems like use of templatizer without an owner & host property forwarding was just a missed use case. I'm making a PR that allows this to work, since it's so basic and easy to support: <template id="myTemplate">
<div>[[prop]]</div>
</template>
<script>
const MyTemplate = Polymer.Templatize.templatize(myTemplate);
const inst = new MyTemplate({prop: 0});
document.body.appendChild(inst.root);
setInterval(_ => inst.prop++, 1000);
</script> |
Allow templatizer to be used without owner or host prop forwarding. Fixes #4458
I'm upgrading to Polymer 2.0 and in that process decided to change a component from using Templatizer behaviour to using Poymer.Templatize, which seems to be the new thing to use... but I am having issues getting it to work as expected.
https://www.polymer-project.org/2.0/docs/api/namespaces/Polymer.Templatize
Polymer.Templatize.templatize(template)
errors due to no options object existing,instead if I pass an empty options object (and owner/this) then it works. Eg:
Polymer.Templatize.templatize(template, this, {})
.Should the docs be fixed? or should Templatize deal with undefined options?
For example this won't output 'initial' as expected:
but then if you do the following it will output 'new value' correctly:
instance.myProp = 'new value';
JSBin example: https://jsbin.com/zimewuf/edit?html,output
PS. Templatize in Polymer.Tempaltize.templatize is misspelled in the docs.
Chrome 58
Polymer: 2.0-preview
The text was updated successfully, but these errors were encountered: