Skip to content
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

[0.8] x-repeat should support iterating object-valued items #1385

Closed
kevinpschaaf opened this issue Apr 8, 2015 · 54 comments
Closed

[0.8] x-repeat should support iterating object-valued items #1385

kevinpschaaf opened this issue Apr 8, 2015 · 54 comments

Comments

@kevinpschaaf
Copy link
Member

Currently only arrays are supported. Object (and possibly Map) values should also be made iterable.

This was requested in the Polymer 0.5 codebase per googlearchive/polymer-expressions#11.

@arodic
Copy link

arodic commented Apr 8, 2015

Yes, please, please please.

@lgersman
Copy link

lgersman commented Apr 9, 2015

👍

1 similar comment
@chuckh
Copy link
Contributor

chuckh commented Apr 9, 2015

+1

@RB14
Copy link

RB14 commented Apr 9, 2015

I'll add to that and suggest adding support for any iterable object (including generators and other user-defined iterables). I think I requested it in 0.5 few months ago.

@ganadev
Copy link

ganadev commented Apr 20, 2015

+1

3 similar comments
@ternite
Copy link

ternite commented Apr 21, 2015

+1

@mcarey1590
Copy link

+1

@knowlecules
Copy link

+1

@alecbz
Copy link

alecbz commented Jun 4, 2015

+1

@harsimranmaan
Copy link

+1

6 similar comments
@Jamtis
Copy link

Jamtis commented Jul 10, 2015

+1

@jialic
Copy link

jialic commented Aug 6, 2015

+1

@kuma-guy
Copy link

+1

@kingflurkel
Copy link

+1

@laurajmaddox
Copy link

+1

@b0c1
Copy link

b0c1 commented Sep 4, 2015

+1

@zmoshansky
Copy link

Please use the "Subscribe" feature under notifications in the right pane instead of +1'ing this into oblivion; Then everyone avoids getting spammed with useless notification emails.

@Jamtis
Copy link

Jamtis commented Sep 29, 2015

In order to iterate over objects or iterables the 'items' property of the 'dom-repeat' template must differ from Array.
Can be found here.

After thinking about this a little bit I guess the best thing is to set the type to Object to support all Iterable objects.

@Jamtis
Copy link

Jamtis commented Sep 29, 2015

When iterating over key-value iterable should index represent the key or should there be a separate key property?

@jarede
Copy link

jarede commented Oct 2, 2015

+1

@Jamtis
Copy link

Jamtis commented Oct 3, 2015

A possible solution could be to internally convert all Iterable (Object, Array, Set, Map, Generator) to a Map.

I don't know how performant this solution is...

Does someone have a better way to do it?

Additionally:

If we want to support Set/Map (generally) Polymer needs a way to listen to changes made to them.
Polymer can't even listen to Array changes natively, element.push is required.
So Polymer has to implement Set/Map method also... as I stated in #2074.

@fernandojsg
Copy link

Any updates on this? :\ one of the biggest downside I've found on polymer right now

@bvhme
Copy link

bvhme commented Jun 3, 2016

The new Firebase element does no longer support an array like collection AFAIK, this makes an iterable template for objects a lot more relevant again I hope.

@klarkc
Copy link

klarkc commented Aug 19, 2016

A big blocking here, of course, because of Firebase element changes.

@cleaverpj
Copy link

+1

4 similar comments
@Arual90
Copy link

Arual90 commented Oct 26, 2016

+1

@monkybrain
Copy link

+1

@krozycki
Copy link
Contributor

+1

@sreekrishna
Copy link

+1

@derhuebiii
Copy link

+1

@diegocerdan
Copy link

Does Polymer 2.0 help with this issue? Every time I start side-projects using Polymer I step into this problem.

@Pablo-Aldana
Copy link

+1

@dwelby101
Copy link

+1 This would be a really neat feature to have

@NicolasRannou
Copy link

+1

1 similar comment
@baocang
Copy link

baocang commented Apr 5, 2017

+1

@derhuebiii
Copy link

Polymer 2.0 doesn't seem to have this functionality either? At least I cannot find it in the specs?
Are there any plans to implement this? Was hoping so much for Polymer 2.0 ...
https://www.polymer-project.org/2.0/docs/devguide/templates

@togonow
Copy link

togonow commented Sep 18, 2017

+1

1 similar comment
@Geoffrey-Pliez
Copy link

+1

@jogibear9988
Copy link

same as #800 maybe close one

@LarsDenBakker
Copy link
Contributor

+1 seems like such a basic functionality

@derhuebiii
Copy link

Are there any plans for this to come?

@CollectionAgency
Copy link

When will there be a fix for this nonsense?

@stale
Copy link

stale bot commented Mar 13, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 13, 2020
@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically closed after being marked stale. If you're still facing this problem with the above solution, please comment and we'll reopen!

@stale stale bot closed this as completed Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests