Last active
January 2, 2016 16:05
-
-
Save kijanawoodard/a6dcaa2c65b9ecd7692d to your computer and use it in GitHub Desktop.
aurelia search
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="text" class="search" placeholder="search by name or number" value.bind="searchText & debounce" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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