在 findChilds 操作中,发出请求,在我的例子中,数据存储在 firebase 中,并将接收到的数据添加到已选择的数据中。数据来找我,但我不知道下一步该怎么做……如何将它们添加到模型中以便在模板中显示它们?
export default Ember.Route.extend({
model() {
return this.store.query('category', {
orderBy: 'parent',
equalTo: 'null'
});
},
actions: {
deleteCategory(category) {
let confirmation = confirm('Are you sure?');
if (confirmation) {
category.destroyRecord();
}
},
findChilds(id) {
// вот здесь к примеру сделать запрос
var childs = this.store.query('category', {
orderBy: 'parent',
equalTo: id
});
}
}
});
1 个回答