Skip to content

Instantly share code, notes, and snippets.

@sergeyt
Last active December 31, 2015 22:39
Show Gist options
  • Save sergeyt/8054730 to your computer and use it in GitHub Desktop.
Save sergeyt/8054730 to your computer and use it in GitHub Desktop.
gist for meteor-typeahead demo
Repos = new Meteor.Collection("repos");
if (Meteor.isServer){
Meteor.startup(function(){
Repos.remove({});
// fill repos from private repos.json asset
JSON.parse(Assets.getText('repos.json')).forEach(function(it){
Repos.insert(it);
});
});
}
if (Meteor.isClient){
Template.demo.repos = function(){
return Repos.find().fetch();
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment