fix autocompleter example in docs

This commit is contained in:
Leo Horie 2014-04-06 22:09:20 -04:00
parent bdd016de3f
commit 232b02a082
3 changed files with 42 additions and 42 deletions

View file

@ -126,17 +126,17 @@ autocompleter.controller = function(data, getter) {
this.change = function(value) {
this.value(value);
var data = value === "" ? [] : data.filter(function(item) {
var list = value === "" ? [] : data.filter(function(item) {
return this.getter(item).toLowerCase().indexOf(value.toLowerCase()) > -1;
}, this);
this.data(data);
this.data(list);
};
//this method is called when an option is selected. It triggers an `onchange` event
this.select = function(value) {
this.value(value);
this.data([]);
if (this.onchange) this.onchange({target: {value: value}});
if (this.onchange) this.onchange({currentTarget: {value: value}});
};
}

Binary file not shown.