Skip to content

Instantly share code, notes, and snippets.

@tleperou
Last active July 2, 2019 06:35
Show Gist options
  • Save tleperou/4f369a2585f200e16c89e349c81bfedb to your computer and use it in GitHub Desktop.
Save tleperou/4f369a2585f200e16c89e349c81bfedb to your computer and use it in GitHub Desktop.
import Route from '@ember/routing/route';
import { action } from '@ember/object';
import { inject as service } from '@ember/service';
import { queryParam } from 'ember-query-params-service';
export default class ApplicationRoute extends Route {
@queryParam search;
@queryParam limit;
@queryParam skip;
@service store
model() {
const { search, limit, skip } = this
return this.store.query('article', { search, limit, skip })
}
@action
activate() {
// handle transition in the route
}
@action
deactivate() {
// handle transition out the route
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment