Skip to content

Instantly share code, notes, and snippets.

@electronicbites
Created April 8, 2018 20:54
Show Gist options
  • Save electronicbites/6ab19768cc0628d02bc7500d24860296 to your computer and use it in GitHub Desktop.
Save electronicbites/6ab19768cc0628d02bc7500d24860296 to your computer and use it in GitHub Desktop.
export default Controller.extend({
actions: {
incrementPage() {
let page = this.get('page');
let max = this.get('products.meta.total_pages');
if (page < max) {
this.set('page', page + 1);
}
},
decrementPage() {
let page = this.get('page');
if (page > 2) {
this.set('page', page - 1);
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment