0

I've an indexed array. How can I loop thru it using Handlebars? I'm using #each /each for loop but to which variable is the value assigned inside the block.

My data loops like this.

{
            id: "12424",
            title: "Chit Chat with Kimberly Bauer",
            description: "Discuss about what's going to happen to Jack Bauer in Season 9 of 24",
            from: "12/16/2012 9:00am EST",
            to: "12/16/2012 10:00am EST",
            duration: "1:00 hr",
            invitees: [
                "[email protected]",
                "[email protected]",
                "[email protected]",
                "[email protected]",
                "[email protected]"
            ]
        }

I want to display all the invitees.

1 Answer 1

1

I found the answer. It is assigned to . (dot)

It can be used as {{.}}

Sign up to request clarification or add additional context in comments.

2 Comments

or for more clarity you can use {{this}}
Or, better yet, assign the value to a variable i.e. {{#each invitee in invitees}} and access it using {{invitee}}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.