Polymer Articles

Found 1 articles

Polymer 1.0 dom-repeat should display index starting at 1 with HTML

Samual Sam
Samual Sam
Updated on 15-Mar-2026 205 Views

Polymer.js is a JavaScript library created by Google that allows reusing HTML elements for building applications with components. When using dom-repeat in Polymer 1.0, the index starts at 0 by default, but you can display it starting from 1. The Problem By default, dom-repeat provides a zero-based index. If you want to display numbers starting from 1 (like a numbered list), you need to add 1 to the index value. Solution: Using a Helper Function Create a helper function that adds 1 to the index: displayIndex: function(index) { return index ...

Read More
Showing 1–1 of 1 articles
« Prev 1 Next »
Advertisements