How do I call a function in template while iterating
{{if $self := .}}
{{range $index,$val := .Options.Attrs}}
{{$self.GetOptionKey $index}} //i want to pass the variable index to
the function
{{end}}{{end}}
Hi
How do I call a function in template while iterating
If I call the function outside the
{{range $index,$val := .Options.Attrs}}
{{$index}}
{{end}}
{{.GetOptionKey 1}} //GetOptionKey is my function
the function executes
But when I try this
{{range $index,$val := .Options.Attrs}}
{{.GetOptionKey $index}} //i want to pass the variable index to