Skip to content

Instantly share code, notes, and snippets.

@alexspeller
Created August 18, 2014 16:29
Show Gist options
  • Save alexspeller/2ad65a3616d9a3d1bcf7 to your computer and use it in GitHub Desktop.
Save alexspeller/2ad65a3616d9a3d1bcf7 to your computer and use it in GitHub Desktop.
App.FilteredRoute = Em.Route.extend
page: 1
query: null
model: ->
@store.find('something', page: @page, query: @query)
actions:
nextPage: ->
@page += 1
@refresh()
previousPage: ->
@page -= 1
@refresh()
query: (string) ->
@query = string
@refresh()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment