码迷,mamicode.com
首页 > 移动开发 > 详细

3.2 Templates -- The Application Template

时间:2016-01-21 18:53:06      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:

1. 当你的应用程序启动时application模板是默认被渲染的的模板。

2. 你用该把你的header, footer和其他任何的装饰内容放到这里。此外,你应该有至少一个{{outlet}}:它是一个占位符,路由器将根据当前的URL填入适当的模板。

3. example:

app/templates/application.hbs

<header>
  <h1>Igor‘s Blog</h1>
</header>

<div>
  {{outlet}}
</div>

<footer>
  &copy;2013 Igor‘s Publishing, Inc.
</footer>
  • header, footer将一直被显示在屏幕上,但是<div>中的内容将会根据用户当前的路由发生变化,例如/posts或者/posts/15

4. Ember CLI将会创建为你application.hbs,默认放在app/templates/application.hbs

3.2 Templates -- The Application Template

标签:

原文地址:http://www.cnblogs.com/sunshineground/p/5148586.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!