Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ember.js 如何将值复制到Ember中的空对象列表_Ember.js_Ember 1 - Fatal编程技术网

Ember.js 如何将值复制到Ember中的空对象列表

Ember.js 如何将值复制到Ember中的空对象列表,ember.js,ember-1,Ember.js,Ember 1,我有一个空的余烬对象列表 formattedlist: [ { id:'', topic:'', content:'' } ] 我将值推送到这个列表,同时从另一个列表进行迭代 _languageChange: function () { let that = this; let languageTexts = this.get('app').lang; this.get('formattedlist').

我有一个空的余烬对象列表

formattedlist: [
    {
        id:'',
        topic:'',
        content:''
    }
]
我将值推送到这个列表,同时从另一个列表进行迭代

_languageChange: function () {
    let that = this;
    let languageTexts = this.get('app').lang;

    this.get('formattedlist').clear();

    Ember.$.each(this.get('quizlist'),function(index, params) {
        let topic = languageTexts.messages[params.topic];
        let content = languageTexts.messages[params.content];
        that.get('formattedlist').pushObject({id:params.id, topic: topic, content: content});
    });
}
而且效果很好。我需要创建一个本地对象列表,并将值设置为本地对象,而不是清除和推送对象。

并将该列表分配给类级变量
formattedlist:[]
。我使用的是
ember 1.1
版本。
请帮帮我。 多谢各位