opened
taai
username_0
This is what I want:

```
{{#each schools 'school'}}
	{{#each school.students 'student'}}
		<p>{{student.name}} is in school {{school.name}}</p>
	{{/each}}
{{/each}}
```

The second (optional) argument for the ```#each``` helper should be the name of variable which would hold the item of the list. I think I have seen this in some other frameworks, so this is nothing new.

Because this is how I can control the access to each object specifically, otherways I couldn't access, in this case, the "school name" from inside of "students" loop, because they have the same attribute name – "name".

As I did read the stache helpers code, it should be easy to implement just like the ```@index``` and ```@key``` variables.
https://github.com/canjs/canjs/blob/master/view/stache/mustache_helpers.js#L30

For now I'm making a helper for my own needs, but I would like to see the same in canJS out of the box. I can also program this myself and make a pull request, only if you are willing to accept it.

By the way, is there a better way to communicate with you than in Freenode IRC channel? When I go there, there are just few people who probably are away from keyboard anyway...
foreach (itemList as item) in stache
issue
closed
justinbmeyer
username_1
issue
created
justinbmeyer
username_1
Yes.  no one uses freenode anymore.  We are all on: https://gitter.im/canjs/canjs

Closing for a similar previous issue https://github.com/canjs/can-stache/issues/16
comment
created
taai
username_0
@username_1 Alright... Do you accept that it is needed? Do you want me to implement this and make a pull request? Which branch should I use as a base for changes – "master"?
comment
created
justinbmeyer
username_1
Yes, I think @username_2 might be looking at it too.  

All features are going to be added in 3.0, so that `can-stache` repo is the place to make changes.
comment
created
pYr0x
username_2
@username_0 if you have a working solution with also a test we will accept yours...
comment
created
taai
username_0
@username_2 Please have a look at my pull request! I hope that's that simple and I'm not misunderstanding anything...
comment
created
taai
username_0
@username_2 By the way, in the pull request it did the Travis CI test and it failed... But that's not because of my code. It fails randomly this test:
https://github.com/canjs/can-stache/blob/master/test/stache-test.js#L2901
If you run tests again, it should pass the tests... I suspect it has something to do with ```setTimeout```. Maybe the second ```setTimeout``` should be called from inside of the first ```setTimeout```, because browsers doesn't guarantee the execution order of callbacks set with ```setTimeout```? Proof:

- https://nodejs.org/api/timers.html#timers_settimeout_callback_delay_arg
- http://stackoverflow.com/questions/1776239/are-equal-timeouts-executed-in-order-in-javascript/1776684#1776684
comment
created
pYr0x
username_2
@username_0 can you try to wrap the second timeout in the first one?
comment