Skip to content
Advertisement

index operator in handlebars say Unexpected token ,

I have #each loop in my ember app and want to know index of loop, so I try to using {{@index}} like this :

JavaScript

But in chrome, I get this error:

JavaScript

My ember.js version is rc8 and handlebars is 1. I need a solution to find index of #each.

Advertisement

Answer

You can get the contentIndex from itemViewClass of the #each helper

JavaScript

DEMO FIDDLE

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement