Templates 余烬嵌套路由不渲染模板

Templates 余烬嵌套路由不渲染模板,templates,ember.js,routes,nested,request,Templates,Ember.js,Routes,Nested,Request,我使用的是最新的ember cli版本2.12.1和ember 我已将我的路由配置为: Router.map(function() { this.route('companies', function() { this.route('companydetail', { path: '/:company_id' }, function() { this.route('employees', function() { this.route

我使用的是最新的ember cli版本2.12.1和ember

我已将我的路由配置为:

 Router.map(function() {
  this.route('companies', function() {
    this.route('companydetail', {
      path: '/:company_id'
    }, function() {
      this.route('employees', function() {
        this.route('employeedetail', {
          path: '/:employee_id'
        });
      });
    });
  });
});
模板在中

/templates/companies/index.hbs
/templates/companies/companydetail.hbs
/templates/companies/companydetail/employees/employees/employeedetail.hbs
我可以链接到路线

{{#link-to "companies.companydetail.employees.employeedetail" model employee}}Edit{{/link-to}}
这就行了。但模板不会被渲染。 而是使用companydetail.hbs。我换了房间 /路由/companys/companydetail/employeedetail.js以呈现正确的模板:

renderTemplate: function(params) {
    this.render('companies/companydetail/employees/employeedetail', {
      into: 'application'
    });
}
这是可行的,但是:对模型的调用(对服务器的请求)没有完成。我可以试着手动打电话,但我开始相信,我的路线有问题

有什么建议吗

更新: url为/companys/1/employees/2。当我单击链接时,当ember构造此url时,不会执行对模型的请求。刷新浏览器页面时,会触发请求。这是一种典型的体验,因为url未更改时不会触发模型调用。但奇怪的是,它改变了,仍然没有模型请求

提前感谢,,
使用的
companydetail.hbs

是正确的。
employeedetail.hbs
应呈现在
companydetail.hbs
内的
{outlet}
中。确保在
companydetail.hbs
内有
{{outlet}
,确保使用的
companydetail.hbs
是正确的。
employeedetail.hbs
应呈现在
companydetail.hbs
内的
{outlet}
中。确保在
companydetail.hbs

/templates/companydetail/employees/employeedetail.hbs
中有一个
{{outlet}
这应该是
/templates/companydetail/employeedetail.hbs
@kumkanillam你说得对。这就是脚本的所在。这是问题中的一个输入错误。对不起
/templates/companys/companydetail/employee/employeedetail.hbs
这应该是
/templates/companys/companydetail/employeedetail.hbs
@kumkanillam你说得对。这就是脚本的所在。这是问题中的一个输入错误。很抱歉嗯,我希望它能在新的页面上呈现,而不是在公司的内部。我尝试了你的解决方案,但没有成功。奇怪的是:当我重新加载页面时,所有请求都是正确的。这是意料之中的。如果您使用模型
{{link to}
,则不会执行
模型
挂钩,因为您已经拥有该模型。如果您不希望模板嵌套,请不要嵌套路由。谢谢您的解释!我的代码现在可以工作了:我将{{链接到}}从{…model employee}更改为{…model.id employee.id},这样不是传递模型,而是传递id和请求triggerd.Hm。我希望它在新页面上呈现,而不是在companydetail内部。我尝试了你的解决方案,但没有成功。奇怪的是:当我重新加载页面时,所有请求都是正确的。这是意料之中的。如果您使用模型
{{link to}
,则不会执行
模型
挂钩,因为您已经拥有该模型。如果您不希望模板嵌套,请不要嵌套路由。谢谢您的解释!我的代码现在可以工作了:我将{{链接到}}从{…model employee}更改为{…model.id employee.id},这样不是传递模型,而是触发id和请求。