Skip to content

Instantly share code, notes, and snippets.

@boxofrox
Created May 29, 2015 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boxofrox/ec6132f3ecd658c5fe24 to your computer and use it in GitHub Desktop.
Save boxofrox/ec6132f3ecd658c5fe24 to your computer and use it in GitHub Desktop.
Meteor template error with #each var in array

main.coffee

if Meteor.isClient
  Session.setDefault('app.ports', ['test'])

  Template.content.helpers(
    app: ->
      ports: Session.get('app.ports')

index.html

<head>
  <title>Template Fail &gt;&lt;</title>
</head>

<body>
    {{> content }}
</body>

<template name="content">
  <select>
    {{#each port in app.ports}}
      <option>{{port}}</option>
    {{/each}}
  </select>
</template>

browser error

Uncaught Error: No such function: port
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment