Ember.js Ember Data-处理通过模板访问的hasmany关系的API错误响应

Ember.js Ember Data-处理通过模板访问的hasmany关系的API错误响应,ember.js,ember-data,Ember.js,Ember Data,我有一个模型,它是通过一个把手模板的hasmany关系访问的 models/post.js export default DS.Model.extend({ comments: DS.hasMany('comment', {async: true}), }); template/post.hbs {{#each comment in post.comments}} 我正在使用REST适配器,需要处理从handlebars模板帮助程序执行的GET/posts/:id/注释的成功和失

我有一个模型,它是通过一个把手模板的hasmany关系访问的

models/post.js

export default DS.Model.extend({
    comments: DS.hasMany('comment', {async: true}),
});

template/post.hbs

{{#each comment in post.comments}}
我正在使用REST适配器,需要处理从handlebars模板帮助程序执行的GET/posts/:id/注释的成功和失败响应

如果这是在控制器/路由中完成的,我可以执行以下操作:

this.store.find('post', post_id)
  .then(function(post) {
     post.get('comments);
  }, function(errors) {
     // handle errors
  });

当通过模板访问时,我在何处执行等效操作?非常感谢任何帮助、言语或智慧

看起来这个钩子在适配器级别可用,但我决定在控制器中显式加载模型,而不是依赖模板