<tr>
<td>rank</td>
<td>abc</td>
</tr>
{{ range $index,$abc := .abc }}
<tr>
<td>{{$index}}</td> // 0
<td>{{$abc}}</td>
</tr>
{{end}}
how to {{$index}} starts with 1
{{add $index 1}} - unction "add" not defined
{{$index + 1}} - illegal number syntax: "+"
You can pass a custom function into your controller's ViewArgs as a variable.
You can then use
$.addOneto access the function in a loop. To use it as a function, you have to add acallkeyword before it: