0
votes

Got a weird problem here with Meteor, Blaze and Spacebars. Here's my setup: I have a helper that returns an array [8,8,8,8,8,0,0]. But when I print it out in my template with {{#each hours}}{{this}}{{/each}}, I get the following order: [8,0,8,8,8,8,0].

Why is this happening, am I missing something?

Additionally, when I print out the {{hours}} in the template without the each loop, I get the right order.

UPD: For @zim: here's my helper:

hours() {
  return [8,8,8,8,8,0,0];
}

And the template is pretty much that I described in the post:

{{#each hours}}
  {{this}}
{{/each}}
1
Can you show some code? - zim
Here's my helper: hours() { return [8,8,8,8,8,0,0]; } And the template is pretty much that I described in the post: {{#each hours}} {{this}} {{/each}} Sorry, can't cope with the markup, will add to the post. - A. Martyn
i am not able to reproduce the behavior you're seeing. i've tried it with an each on "hours" and a "this" in the body, and also with an each on "hour in hours" and an "hour" in the body. - zim

1 Answers

0
votes

Oddly, it's working fine today. I have no idea what it was, but will get back to this topic whenever I experience this problem again.