I'm trying to loop over items and render it in separate template, but {{ . }}
in item.html
contains root variables instead of a single item. I tried to assign item to a variable {{ range $i, $item := .Items }}
, but the result is the same.
<!-- list.html -->
{{ range .Items }}
{{ . }} this one is OK
{{ render "item.html" }}
{{ end }}
<!-- item.html -->
{{ . }} this one is not