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
599 stars 82 forks source link

Add example of looping over objects to cheatsheet #79

Closed first-timers[bot] closed 5 years ago

first-timers[bot] commented 5 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

@@ -6,9 +6,15 @@ Display this!
 They don't equal
 {{/if}}

-## Looping over arrays -sqrl -{{each(options.someArray)}} -The current array item is {{@this}}, the current index is {{@index}} -{{/each}} - \ No newline at end of file +## Looping over arrays +sqrl +{{each(options.someArray)}} +The current array item is {{@this}}, the current index is {{@index}} +{{/each}} + +## Looping over objects + +{{foreach(options.someObject)}} +The current object key is {{@key}}, and the value is {{@this}} +{{/foreach}} +



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

- [ ] πŸ”€ **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/)

- [ ] 🏁 **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).
ilhamtaufiq commented 5 years ago

may i claim this?

nebrelbug commented 5 years ago

@ilhamtaufiq sure! Consider it claimed.

ullayne02 commented 5 years ago

Can i still claim this?

mosman128 commented 5 years ago

I'd like to claim this issue

nebrelbug commented 5 years ago

@ullayne02 and @mosman128 sorry, it's already been claimed. Keep an eye out for new issues very soon though!