# HG changeset patch
# User nowmad@nowmads-macbook-pro.local
# Date 1449762583 -3600
# Node ID b6815b3d46bd9798cadd2126f6d8646048600e92
# Parent 9887379e627f9e816f98ad0dcb7591874d4d54e5
pass arguments to results components
diff -r 9887379e627f -r b6815b3d46bd cms/app-client/app/controllers/results.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/app/controllers/results.js Thu Dec 10 16:49:43 2015 +0100
@@ -0,0 +1,17 @@
+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;
+ }
+ })
+});
diff -r 9887379e627f -r b6815b3d46bd cms/app-client/app/templates/results.hbs
--- a/cms/app-client/app/templates/results.hbs Thu Dec 10 16:47:51 2015 +0100
+++ b/cms/app-client/app/templates/results.hbs Thu Dec 10 16:49:43 2015 +0100
@@ -1,4 +1,9 @@
RESULTS
+ {{#each model as |item| }}
+
+ {{ item.name }}
+
+ {{/each}}
diff -r 9887379e627f -r b6815b3d46bd cms/app-client/tests/unit/controllers/results-test.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/tests/unit/controllers/results-test.js Thu Dec 10 16:49:43 2015 +0100
@@ -0,0 +1,12 @@
+import { moduleFor, test } from 'ember-qunit';
+
+moduleFor('controller:results', {
+ // Specify the other units that are required for this test.
+ // needs: ['controller:foo']
+});
+
+// Replace this with your real tests.
+test('it exists', function(assert) {
+ var controller = this.subject();
+ assert.ok(controller);
+});
diff -r 9887379e627f -r b6815b3d46bd cms/app-client/tests/unit/routes/results-test.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cms/app-client/tests/unit/routes/results-test.js Thu Dec 10 16:49:43 2015 +0100
@@ -0,0 +1,11 @@
+import { moduleFor, test } from 'ember-qunit';
+
+moduleFor('route:results', 'Unit | Route | results', {
+ // Specify the other units that are required for this test.
+ // needs: ['controller:foo']
+});
+
+test('it exists', function(assert) {
+ var route = this.subject();
+ assert.ok(route);
+});