cms/app-client/app/routes/tabs/carto.js
author ymh <ymh.work@gmail.com>
Tue, 27 Sep 2016 23:43:29 +0200
changeset 304 20071981ba2a
parent 291 478cdcc56a63
child 309 6ab16926b675
permissions -rw-r--r--
add location and geonames resolvers and api

import Ember from 'ember';

export default Ember.Route.extend({

    modelQueryParam: 'world',

    model: function() {
        return this.store.query('geostat', {
            'area': this.get('modelQueryParam'),
            'details': 1
        });
    },

    deactivate: function () {
        this.set('modelQueryParam', 'world');
    },

    setupController: function(controller) {
        this._super(...arguments);
        controller.set('modelQueryParam', this.get('modelQueryParam'));
    },

    actions: {
        setModelQueryParam: function(id) {
            this.set('modelQueryParam', id);
            this.refresh();
        }
    }

});