Created
April 8, 2018 20:54
-
-
Save electronicbites/6ab19768cc0628d02bc7500d24860296 to your computer and use it in GitHub Desktop.
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
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