emberjs 循环中设置model的不同属性值

//var grades = ['1', '2', '3', '4', '7', '8', '9'];

            var grades = ['1'];

            grades.forEach(function (item) {

                App.Template.getTemplates(item, term, session).then(function (rs) {



                    var mm = 'm' + item;

                    var m = Ember.Object.create({});

                    m.set( mm,rs);

                    controller.set('model', m);

                    console.log(controller.get('model'));

                }, function (error) { alert('获取错误!'); });

            });

 

你可能感兴趣的:(Model)