jeudi 19 janvier 2017

How to use the FilterBy for multiple data in ember.js

That is controller chat.js code

 queryParams: ['offer_id'],
 offer_id: null,
 filteredChat: Ember.computed('model.@each.offer_id','offer_id',
   function() {
    return this.get('model').filterBy("offer_id" ,this.get("offer_id")).filterBy("id", this.get("offer_id"))
  }),

I am filtering the chat with offer_id.

I want to know that can i use the filterBy like this two times and that is my route chat.js code

queryParams:{
  offer_id:{
   refreshModel : true
 }     
},
model(params) {
      return this.store.query("chat", params).then(() => {
       let model = this.store.peekAll("chat")
       return model
  })
 },




Aucun commentaire:

Enregistrer un commentaire