Skip to content

Instantly share code, notes, and snippets.

@jgdovin
Created April 6, 2015 15:20
Show Gist options
  • Save jgdovin/1188efe486acc8d2f431 to your computer and use it in GitHub Desktop.
Save jgdovin/1188efe486acc8d2f431 to your computer and use it in GitHub Desktop.
Template.newLineItem.helpers({
search : function(query, callback) {
console.log('in search');
Meteor.call('searchProducts', query, {}, function(err, res) {
if (err) {
console.log(err);
return;
}
console.log(callback);
callback(res.map(function(v){
console.log('test');
return {label: v.itemNumber, value: v._id}; }));
});
}
});
console.log of callback returns this:
function render(suggestions) { // 1242
if (!that.canceled && query === that.query) { // 1243
that._render(query, suggestions); // 1244
} // 1245
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment