from #each-iteration

Hi, I got help with this {{each}}-iteration a while back.

    {{#each room in channels}}
        <form class="enterRoom">
            <button type="submit" class="roomJoin">
                <img src="{{room.roomBanner}}" alt=".">
                <input type="hidden" value="{{}}" name="name">
                <div class="inRoom"> 
                    {{#each name in room.inRoom}} 
                        <a href="/c/{{name}}" target="_blank">{{name}}</a> 

It works great. But I don’t seem to find a way of accessing the data from this iteration as I used to.
To get the name for example I would just do But here it doesn’t seem to apply. I took a long look at the Spacebars and Blaze API but it couldn’t find a specific example.

I tried but this will throw an error.

Could someone explain to me how I would access the data in this scenario? Thanks for any help.

When using each room in, this is scoped to the parent, so you should neither use, nor, but simply

'submit .enterRoom'(event) {
  const char = Session.get('activeChar');
  const target =;
  const name =; 
  const isClosed = room.isClosed; // example here

  if(isClosed == true) {
  } else {'inRoom.push', name.value, char, (error) => { if(error) {alert(error.reason);} });

    Session.set('room', name.value);'charactersRoom.update', char, name.value, (error) => { 
      if (error) { 
        alert(error.reason); } 
      else {


If I use it like that it will give this error though:

chat.js:86 Uncaught ReferenceError: room is not defined
    at Object.submit .enterRoom (chat.js:86)
    at blaze.js?hash=51f4a3bdae106610ee48d8eff291f3628713d847:3818
    at Function.Template._withTemplateInstanceFunc (blaze.js?hash=51f4a3bdae106610ee48d8eff291f3628713d847:3769)
    at Blaze.View.<anonymous> (blaze.js?hash=51f4a3bdae106610ee48d8eff291f3628713d847:3817)
    at blaze.js?hash=51f4a3bdae106610ee48d8eff291f3628713d847:2617
    at Object.Blaze._withCurrentView (blaze.js?hash=51f4a3bdae106610ee48d8eff291f3628713d847:2271)
    at Blaze._DOMRange.<anonymous> (blaze.js?hash=51f4a3bdae106610ee48d8eff291f3628713d847:2616)
    at HTMLFormElement.<anonymous> (blaze.js?hash=51f4a3bdae106610ee48d8eff291f3628713d847:863)
    at HTMLDivElement.dispatch (modules.js?hash=8331598f8baf48556a442a64933e9b70b778274a:9685)
    at HTMLDivElement.elemData.handle (modules.js?hash=8331598f8baf48556a442a64933e9b70b778274a:9492)

Did I forget to include something on that event in order to get access?