squirrellyjs / squirrelly

Semi-embedded JS template engine that supports helpers, filters, partials, and template inheritance. 4KB minzipped, written in TypeScript β›Ί
https://squirrelly.js.org
MIT License
635 stars 83 forks source link

Add example of looping over arrays to cheatsheet #74

Closed first-timers[bot] closed 6 years ago

first-timers[bot] commented 6 years ago

πŸ†•πŸ₯☝ First Timers Only.

This issue is reserved for people who never contributed to Open Source before. We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you πŸ’

About First Timers Only.

πŸ€” What you will need to know.

Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.

πŸ“‹ Step by Step

@@ -1,8 +1,14 @@
 ## Conditionals
-```
+```sqrl
 {{if(options.someval === "someothervalue")}}
 Display this!
 {{#else}}
 They don't equal
 {{/if}}

+## Looping over arrays +sqrl +{{each(options.someArray)}} +The current array item is {{@this}}, the current index is {{@index}} +{{/each}} +



- [x] πŸ’Ύ **Commit** your changes

- [x] πŸ”€ **Start a Pull Request**. There are two ways how you can start a pull request:

1. If you are familiar with the terminal or would like to learn it, [here is a great tutorial](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github) on how to send a pull request using the terminal.

2. You can [edit files directly in your browser](https://help.github.com/articles/editing-files-in-your-repository/)

- [x] 🏁 **Done** Ask in comments for a review :)

### πŸ€”β“ Questions

Leave a comment below!

This issue was created by [First-Timers-Bot](https://github.com/hoodiehq/first-timers-bot).
RyanLilla commented 6 years ago

I can take it!

nebrelbug commented 6 years ago

@RyanLilla great! Reserved.