Guest User

Untitled

a guest
Nov 16th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. import Ember from 'ember';
  2. import MixerGames from '../data/mixer-games';
  3.  
  4. export default Ember.Controller.extend({
  5. appName: 'Ember Twiddle',
  6. MixerGames,
  7. start: 0,
  8. perPage: 5,
  9. lastPage: Ember.computed("perPage", {
  10. get() {
  11. return Math.floor(MixerGames.length / this.get("perPage"));
  12. }
  13. }),
  14.  
  15. actions: {
  16. dec() {
  17. if (this.get("start") > 0) {
  18. this.decrementProperty("start");
  19. }
  20. },
  21.  
  22. inc() {
  23. if (this.get("start") < this.get("lastPage")) {
  24. this.incrementProperty("start");
  25. }
  26. }
  27. }
  28. });
Add Comment
Please, Sign In to add comment