在余烬2中渲染成另类布局

时间:2015-12-15 16:45:35

标签: javascript ember.js

当我尝试从路线渲染到另一种布局时,我收到错误,说明找不到布局。 Uncaught Error: Assertion Failed: You attempted to render into 'popup' but it was not found 是否无法呈现为替代布局?我想渲染视图但没有导航。 如果我渲染到应用程序中它可以正常工作

我的路线看起来像

import Ember from 'ember';

export default Ember.Route.extend({
  model(params) {
    return this.store.find('information', params.information_id);
  },
  renderTemplate: function() {
    this.render('informations/show', {
      into: 'popup'
    });
  }


});

1 个答案:

答案 0 :(得分:0)

路线嵌套将定义您的布局。因此,不要在考虑模型的情况下撰写路线。

如果您只想在应用程序路径上导航,请将它们放在application.index路径中。如果不清楚渲染的是什么,请打开调试。(https://guides.emberjs.com/v1.10.0/understanding-ember/debugging/)。

PS:我们称之为“outlet”