代码之家  ›  专栏  ›  技术社区  ›  Bye

ember应用程序。hbs页{{outlet}}不呈现其他页

  •  0
  • Bye  · 技术社区  · 9 年前

    在模板文件夹中,我创建了两个文件,application。hbs和post.hbs
    应用程序.hbs

    <h2 id="title">balabala</h2>
    {{outlet}}
    

    后.hbs

    <h3>I am from post.hbs</h3>
    

    我预计“balabala I am from post.hbs”会在浏览器中显示,但我只能看到“balabela”。
    有人能帮忙吗?谢谢

    1 回复  |  直到 9 年前
        1
  •  1
  •   mausinc    9 年前

    this.route('post');
    

    最简单的方法是使用ember-cli在将来为您生成文件。

    ember generate route post
    
    
    Result :
    installing
      create app/routes/post.js
      create app/templates/post.hbs
    installing
      create tests/unit/routes/post-test.js