Dynamically add js object to model array in 1.13

后端 未结 3 1896
无人及你
无人及你 2021-02-18 21:11

I have the following code:

var msg = this.store.createRecord({text:\'first title\', createdAt: \"2015-06-22T20:06:06+03:00\" })

this.get(\'model.content\').push         


        
3条回答
  •  一生所求
    2021-02-18 21:38

    Before 1.13:

    this.get('content').pushObjects(messages);
    

    After 1.13:

    messages.forEach(functio(message) {
      this.get('model.content').pushObject(message._internalModel);
    }); 
    

提交回复
热议问题