【发布时间】:2014-02-08 17:21:50
【问题描述】:
希望这不是重复:Why does bloodhound.get() return undefined?
我升级到 typeahead.js 版本 0.10.0。以前的版本正确地返回了建议。现在我收到了undefined 的返回,代码如下:
// instantiate the bloodhound suggestion engine
var engine = new Bloodhound({
datumTokenizer: function (d) { return [d]; },
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: ["(A)labama", "Alaska", "Arizona", "Arkansas"]
});
// initialize the bloodhound suggestion engine
engine.initialize();
$('#typeahead').typeahead(null, {
source: engine.ttAdapter()
});
这是我的小提琴:http://jsfiddle.net/ucUcn/6/
任何想法为什么会发生这种情况?
【问题讨论】:
标签: typeahead typeahead.js bloodhound