Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Ember from 'ember';
- import MixerGames from '../data/mixer-games';
- export default Ember.Controller.extend({
- appName: 'Ember Twiddle',
- MixerGames,
- start: 0,
- perPage: 5,
- lastPage: Ember.computed("perPage", {
- get() {
- return Math.floor(MixerGames.length / this.get("perPage"));
- }
- }),
- actions: {
- dec() {
- if (this.get("start") > 0) {
- this.decrementProperty("start");
- }
- },
- inc() {
- if (this.get("start") < this.get("lastPage")) {
- this.incrementProperty("start");
- }
- }
- }
- });
Add Comment
Please, Sign In to add comment