in the action findChilds, make a request, in my case, the data is stored in firebase and the resulting data is added to the already selected. The data comes to me, but what can I do next I can not understand ... How to add them to the model in order to display it in the template?

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 answer 1

     findChilds(id) { this.store.query('category', { orderBy: 'parent', equalTo: id }).then((records) => { this.get('controller.model').pushObjects(records); }); } 
    • Yes, thanks, already understood) - Artsiom
    • Please try to write more detailed answers. I am sure the author of the question would be grateful for your expert commentary on the code above. - Nicolas Chabanovsky