Created
April 6, 2015 15:20
-
-
Save jgdovin/1188efe486acc8d2f431 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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