title: How to populate bootstrap typeahead in Handlebars?
body: <p>I need to populate a typeahead field from the Twitter Bootstrap in a Handlebars template (environment: Node.js and Meteor).</p>
  
  <p>Here is the template bit:</p>
  
  <pre><code>&lt;input type="text" data-provide="typeahead" data-source={{{names}}}&gt;
  </code></pre>
  
  <p>Here is the Javascript bit:</p>
  
  <pre><code>Template.myTemplate.names = function () {
      var temp = MyCollection.find({}).map(function (x) { return x.name; });
      var ret = "[\"" + temp.join("\", \"") + "\"]";
      return ret;
  };
  </code></pre>
  
  <p>The problem is that the Javascript that is generated is not correct, e.g.,</p>
  
  <pre><code>&lt;input type="text" data-provide="typeahead" data-source="["John", " "Albert"]&gt;
  </code></pre>
  
  <p>and does not work. I think I am over-engineering this and there must be a better way to generate/render the Handlebars template... </p>