yosssi / ace

HTML template engine for Go
MIT License
836 stars 89 forks source link

documentation to create loop #86

Open estrados opened 2 years ago

estrados commented 2 years ago

Is there any documentation to create loop ?

How to iterate variables / create loop in ace

aleybovich commented 2 years ago

Loops are not a feature of ace but rather a feature of golang html/templates. You can use smth like this:

Say your data passed to the template is []string. Then:

ul
  {{ range $k := . }}
   li $k
  {{ end }}