equal
deleted
inserted
replaced
|
1 import Ember from 'ember'; |
|
2 |
|
3 export default Ember.Controller.extend({ |
|
4 queryParams: ['location', 'langue'], |
|
5 location: null, |
|
6 langue: null, |
|
7 filteredSounds: Ember.computed('location', 'langue', 'model', function() { |
|
8 var location = this.get('location'); |
|
9 var langue = this.get('langue'); |
|
10 var sounds = this.get('model'); |
|
11 |
|
12 if (location) { |
|
13 sounds = sounds.filterBy('location', location); |
|
14 } |
|
15 |
|
16 if (langue) { |
|
17 sounds = sounds.filterBy('language', langue); |
|
18 } |
|
19 |
|
20 return sounds; |
|
21 }) |
|
22 }); |