We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am trying to repeat a template that is in the content of a polymer element within the shadow dom, just like it is achieved in polymer-list.
This works for repeat="{{data}}", but not for repeat="{{ d in data }}.
repeat="{{data}}"
repeat="{{ d in data }}
Here is a shortened version of polymer-list, that shows the problem:
<polymer-element name="x-repeat"> <template> <div> <shadow></shadow> </div> </template> <script>Polymer('x-repeat', { data: ["foo", "bar"], enteredView: function() { this.template = this.querySelector('template'); }, templateChanged: function() { this.template.setAttribute('repeat', '{{ data }}'); // works // this.template.setAttribute('repeat', '{{ d in data }}'); // does not work this.template.model = this; } });</script> </polymer-element>
And used like this:
<x-repeat> <template> <div>Data</div> </template> </x-repeat>
repeat="{{data}}" will correctly create two divs, whereas switching the code to repeat="{{ d in data }} creates none.
Is this a bug or expected behaviour?
The text was updated successfully, but these errors were encountered:
The "in" syntax is provided by the polymer-expressions library, and requires you to set "bindingDelegate" on the template to use that syntax.
this.template.bindingDelegate = new PolymerExpressions(); this.template.setAttribute('repeat', '{{ d in data }}');
Here is a working JSBin version: http://jsbin.com/UVIJoha/1/edit
Sorry, something went wrong.
thank you! works like a charm! :)
No branches or pull requests
I am trying to repeat a template that is in the content of a polymer element within the shadow dom, just like it is achieved in polymer-list.
This works for
repeat="{{data}}"
, but not forrepeat="{{ d in data }}
.Here is a shortened version of polymer-list, that shows the problem:
And used like this:
repeat="{{data}}"
will correctly create two divs, whereas switching the code torepeat="{{ d in data }}
creates none.Is this a bug or expected behaviour?
The text was updated successfully, but these errors were encountered: