【问题标题】:How can I prevent the application.hbs from appearing in its routes如何防止 application.hbs 出现在其路由中
【发布时间】:2020-02-10 08:09:30
【问题描述】:

我有一个包含多个路由的 Ember 应用程序。但是,我不希望来自application.hbs 的内容出现在其路由中。我试过了:

renderTemplate: function () {
  this.render("another_outlet");
}

但它会在路由中显示来自another_outlet.hbs 的内容以及来自application.hbs 的内容。

【问题讨论】:

    标签: javascript ember.js routes ember-router


    【解决方案1】:

    你没有。 application.hbs 的唯一目的是有一个地方放置应该始终可见的东西。

    如果您只想在应用的根目录 (/) 上添加某些内容,则应将其放入 index.hbs

    【讨论】:

      猜你喜欢
      • 2021-01-31
      • 2014-10-28
      • 1970-01-01
      • 1970-01-01
      • 2018-08-21
      • 2015-06-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多