Skip to content

Instantly share code, notes, and snippets.

@fritz-gerneth
Created May 9, 2013 22:09
Show Gist options
  • Save fritz-gerneth/5551001 to your computer and use it in GitHub Desktop.
Save fritz-gerneth/5551001 to your computer and use it in GitHub Desktop.
Bootstrap Typeahead
Template['project.index'].rendered = function () {
"use strict";
$('#project-index-add-member').typeahead({
source: function (query, process) {
Meteor.subscribe('user.emails', query, function () {
var mailsResult = Meteor.users.find({
"emails.address": new RegExp(query)
}).fetch();
var mails = [];
_.each(mailsResult, function (res) {
mails.push(res.emails[0].address);
});
process(mails);
});
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment