controller.js 703 Bytes
/*
 * @Author: Targaryen
 * @Date: 2017-04-26 17:19:19
 * @Last Modified by: Targaryen
 * @Last Modified time: 2017-04-27 14:48:55
 */
'use strict';

import {Controller} from 'yoho-mvc';
import {
    NavView
} from './view';
import {
    Guang
} from './model';

class IndexController extends Controller {
    constructor() {
        super();
        this.navView = new NavView();
        this.guangModel = new Guang();
        this.navView.on('navchange', this.fetchList.bind(this));
    }

    fetchList(e, type) {
        this.guangModel.loadMore({
            type: type
        }).then(result => {
            this.navView.listChange(result);
        });
    }
}

module.exports = IndexController;