Closed samurai-jack closed 9 years ago
Where is my mistake? Instead Boston Celtics I get "_query":"b","undefined":"Boston Celtics" I get code from http://typeahead.meteor.com
I also installed a demo application from the website https://github.com/sergeyt/meteor-typeahead/tree/master/demo and the results in the "multiple datasets" is as follows.: {"_id":"oMSzRTiL3rLEwJ5sZ","name":"Boston Celtics"}
Please help
demo.html
<head> <title>hello</title> </head> <body> {{> hello}} </body> <template name="hello"> <input class="form-control typeahead" name="team" type="text" placeholder="NBA and NHL teams" autocomplete="off" spellcheck="off" data-sets="teams"/> </template>
demo.js
Nba = new Meteor.Collection("nba"); Nhl = new Meteor.Collection("nhl"); if (Meteor.isServer){ Nba.insert({name:'Boston Celtics'}); Nhl.insert({name:'New York Islanders'}); } if (Meteor.isClient) { Template.hello.teams = function(){ return [ { name: 'nba-teams', local: function() { return Nba.find().fetch().map(function(it){ return it.name; }); }, # header: '<h3 class="league-name">NBA Teams</h3>' }, { name: 'nhl-teams', local: function() { return Nhl.find().fetch().map(function(it){ return it.name; }); }, header: '<h3 class="league-name">NHL Teams</h3>' } ]; }; Template.hello.rendered = function() { Meteor.typeahead.inject(); } }
@samurai-jack http://typeahead.meteor.com is out-dated, see demo app in this repo
closing since demo app has working example
Where is my mistake? Instead Boston Celtics I get "_query":"b","undefined":"Boston Celtics" I get code from http://typeahead.meteor.com
I also installed a demo application from the website https://github.com/sergeyt/meteor-typeahead/tree/master/demo and the results in the "multiple datasets" is as follows.: {"_id":"oMSzRTiL3rLEwJ5sZ","name":"Boston Celtics"}
Please help
demo.html
demo.js