Merge pull request #249 from nickolasgregory/patch-3
docs: tweaked example components setter-getter
This commit is contained in:
commit
6949676e4f
1 changed files with 2 additions and 2 deletions
|
|
@ -99,7 +99,7 @@ autocompleter.controller = function(data, getter) {
|
||||||
this.change = function(value) {
|
this.change = function(value) {
|
||||||
this.value(value);
|
this.value(value);
|
||||||
|
|
||||||
var list = value === "" ? [] : data.filter(function(item) {
|
var list = value === "" ? [] : data().filter(function(item) {
|
||||||
return this.getter(item).toLowerCase().indexOf(value.toLowerCase()) > -1;
|
return this.getter(item).toLowerCase().indexOf(value.toLowerCase()) > -1;
|
||||||
}, this);
|
}, this);
|
||||||
this.data(list);
|
this.data(list);
|
||||||
|
|
@ -130,7 +130,7 @@ var dashboard = {}
|
||||||
|
|
||||||
dashboard.controller = function() {
|
dashboard.controller = function() {
|
||||||
this.names = m.prop([{id: 1, name: "John"}, {id: 2, name: "Bob"}, {id: 2, name: "Mary"}]);
|
this.names = m.prop([{id: 1, name: "John"}, {id: 2, name: "Bob"}, {id: 2, name: "Mary"}]);
|
||||||
this.autocompleter = new autocompleter.controller(this.names(), function(item) {
|
this.autocompleter = new autocompleter.controller(this.names, function(item) {
|
||||||
return item.name;
|
return item.name;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue