dimanche 17 septembre 2017

Ember fire filter data in controller

I'm new to ember, what I've created is a task manager app in Ember. I've got a model for tasks which is the following:

import DS from 'ember-data';

export default DS.Model.extend({
    title: DS.attr('string'),
    location: DS.attr('string'),
    date: DS.attr('date'),
    archive: DS.attr('boolean'),
});

I've also got it to show all the tasks for this model in a tasklist page. However I'm currently having issues of filtering only the tasks where archive is not equal to true.

In my tasklist route I've got this to pull through my task

model: function () {    
        return this.store.findAll('task');   
    }

However i need this to filter all tasks where archive is equal to false. I do I add this here or into my controller.




Aucun commentaire:

Enregistrer un commentaire