How to increment index number of array in template
-
Hi sir,
I have an array i want to show serial number in template i just add 1 with index but throws error
Can you please show me one example?
-
Could you share a playground example for better understanding? Thank you
https://playground.jsreport.net/
-
My array is,
let testArr = [
{'id':1,'Name'':Test1},
{'id':2,'Name'':Test2}
];My Template code is,
I want to show serial number starting 1,2,3 etc.So i add {{2}} + 1 but it throw error
-
You can't write expressions to
{{
in handlebars.
You need to write a custom helper.For example
{{plusOne 3}}
function plusOne(val) { return val + 1 }