Skip to content

Instantly share code, notes, and snippets.

@kijanawoodard
Last active January 2, 2016 16:05
Show Gist options
  • Save kijanawoodard/a6dcaa2c65b9ecd7692d to your computer and use it in GitHub Desktop.
Save kijanawoodard/a6dcaa2c65b9ecd7692d to your computer and use it in GitHub Desktop.
aurelia search
<input type="text" class="search" placeholder="search by name or number" value.bind="searchText & debounce" />
import {inject, bindable} from 'aurelia-framework';
import {Api} from 'components/api';
import moment from 'moment';
@inject(Api)
export class History {
items = [];
@bindable searchText = '';
constructor(api) {
this.api = api;
}
activate() {
return this.load();
}
load() {
return this.api.get("history", {search: this.searchText})
.then(r => {
this.items;
});
}
searchTextChanged(newValue){
this.load();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment