Tuesday, 15 July 2014

mongodb - Return an object from typeahead package in meteorjs -



mongodb - Return an object from typeahead package in meteorjs -

i've added atmospherejs.com/package/typeahead meteor project , it's working fine. it's returning string can alter typeahead homecoming object , have template render object accordingly? need _id in add-on name participant i'm adding mongodb-collection.

js-file:

template.raceaddparticipant.acparticipants = function () { homecoming participants.find().fetch().map(function (post) { homecoming post.name; }); };

html-file:

<input class="form-control typeahead" autocomplete="off" spellcheck="off" data-source="acparticipants" name="name" type="text" value="" placeholder="participant" />

regards claus

typeahead not designed meteor , need lot of wrangling work strings returns.

one solution utilize https://github.com/mizzao/meteor-autocomplete, works of meteor collections instead of arrays, reactive, , supports rendering using meteor templates proper info contexts (i.e. _id , other fields). it's typeahead, designed around meteor.

mongodb meteor typeahead.js

No comments:

Post a Comment