How to extend Polymer's dom-repeat

Viewed 88

I'd like to change some properties of Polymer's dom-repeat, specifically I'd like to change the default value for the 'as' property and change the name of (or add an alias) for the 'items' property.

I admit this is not a particularly important issue, but it would help reduce some terminology overlap in the app. Also I'm just curious how to go about doing it.

I thought I could maybe create a class that extends Polymer.DomRepeat, adding/adjusting values appropriately, and register that new class as a custom element.. then use ... which would essentially be a dom-repeat element but with my adjustments. That didn't work - it didn't even perform dom-repeat functionality, not sure if the template element was even associated/registered with the "mycustomelement" at all.

I know I could create a full-fledged PolymerElement that wraps dom-repeat, or use Templatizer to recreate dom-repeat, but that seems more complicated than I need and I don't want to add shadow-dom, etc.

Anyway, just looking for ideas, thoughts?

PS. I'm using Polymer 2.0

0 Answers
Related