cms/app-client/app/controllers/results.js
author nowmad@nowmads-macbook-pro.local
Fri, 11 Dec 2015 13:13:47 +0100
changeset 51 70dff07a76ff
parent 41 b6815b3d46bd
permissions -rw-r--r--
add click event on visu-carto and visu-langue and update the url with the selected element as filter parameter

import Ember from 'ember';

export default Ember.Controller.extend({
  queryParams: ['location'],
  location: null,
  filteredSounds: Ember.computed('location', 'model', function() {
    var location = this.get('location');
    console.log("model ? ", this.get('model'));
    var sounds = this.get('model');

    if (location) {
      return sounds.filterBy('location', location);
    } else {
      return sounds;
    }
  })
});