cms/app-client/app/controllers/application.js
changeset 51 70dff07a76ff
child 58 6c03fafb6b62
equal deleted inserted replaced
50:182f46ea5a56 51:70dff07a76ff
       
     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 });