lundi 16 avril 2018

Ember: Route-Model returns all values, not filtered ones

This is the code:

import Route from '@ember/routing/route';

export default Route.extend({
    model(param) {
        return this.get('store').findAll('rentals').then(results => {
            return results.filterBy('enabled', false);
        });
    }
});

When I do console.log(results.filterBy('enabled', false)); it returns filtered ones. But the return returns all values be the enabled true or false.

How to make it return filtered ones only?




Aucun commentaire:

Enregistrer un commentaire