-
-
Save chrisjlee/77aa23b4a6032aa502e4 to your computer and use it in GitHub Desktop.
Filter route example with pagination
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
App.FilteredRoute = Em.Route.extend({ | |
page: 1, | |
query: null, | |
model: function() { | |
return this.store.find('something', { | |
page: this.page, | |
query: this.query | |
}); | |
}, | |
actions: { | |
nextPage: function() { | |
this.page += 1; | |
return this.refresh(); | |
}, | |
previousPage: function() { | |
this.page -= 1; | |
return this.refresh(); | |
}, | |
query: function(string) { | |
this.query = string; | |
return this.refresh(); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment