cms/app-client/app/controllers/results.js
author nowmad@nowmads-macbook-pro.local
Thu, 10 Dec 2015 16:49:43 +0100
changeset 41 b6815b3d46bd
permissions -rw-r--r--
pass arguments to results components

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;
    }
  })
});