如何呈现一个完整的新模板并将应用程序模板保留在ember中
how to render a complete new template and leave the application template in ember
我是ember和javascript的新手。我设计了一个主页(application.hbs)。现在application.hbs中有一个选项(About us),应该重定向到About us页面(全新)。我应该如何完全离开主页,转到About us页。现在它正在主页下面显示关于我们页面的内容(application.hbs)。
application.hbs(代码片段)
<section id = "FollowUs">
<div class = "follow container-fluid">
<div class="row section_blurb">
<div class="col-xs-12 col-sm-4">
<h1>example</h1>
<a href ="#terms"><p>Home</p></a>
<a href ="#terms"><p>Contact</p></a>
<p>{{#link-to "aboutus"}}About Us{{/link-to}}</p>
</div>
<div class="col-xs-12 col-sm-4">
<h1>Dolor Sit Amet </h1>
<a href ="#terms"><p>Term & Conditions</p></a>
<a href ="#privacy"><p>Privacy Policy</p></a>
<a href ="#terms"><p>Lorem Ipsum</p></a>
</div>
<div class="col-xs-12 col-sm-4">
<h1>Contact</h1>
<p>99999999999</p>
<a href ="#privacy"><p>hello@gmail.com</p></a>
</div>
<div class="col-sm-6">
<h1>Follow Us</h1>
<div class = "row">
<div class="col-xs-4 col-sm-2 col-sm-offset-2">
<a href = "https://www.facebook.com/">
<img src="images/ic_facebook yellow.svg" class="img-responsive"></a>
</div>
<div class="col-xs-4 col-sm-2 col-sm-offset-2">
<a href = "https://twitter.com/">
<img src="images/ic_twitter yellow.svg" class ="img-responsive"></a>
</div>
<div class="col-xs-4 col-sm-2 col-sm-offset-2">
<a href = "">
<img src="../images/ic_google plus yellow.svg" class="img-responsive"></a>
</div>
<div class="col-xs-4 col-sm-2 col-sm-offset-2">
<a href = "#facebook">
<img src="../images/ic_instagram yellow.svg" class="img-responsive"></a>
</div>
</div>
</div>
</div>
</div>
</section>
router.js
import Ember from 'ember';
import config from './config/environment';
var Router = Ember.Router.extend({
location: config.locationType
});
Router.map(function() {
this.route("aboutus");
});
export default Router;
关于我们.hbs
<p>hello</p>
{{outlet}}
Maruti,您将希望将application.hbs
模板的大部分内容移动到index.hbs模板,只保留application.hbs
中的导航。
当您导航到应用程序的根目录时,出口{{outlet}}
是ember渲染index.hbs的地方。然后,当您导航到aboutus
路由时,成员将删除index.hbs
模板并将其替换为aboutus.hbs
模板。
相关文章:
- Canvas Html5绘图应用程序,移动画布会导致重大问题
- Emberjs应用程序加载在除Index之外的所有路由上
- 使用电话间隙在Android应用程序中显示SQL Lite的数据
- 在AngularJS应用程序中使用封装指令和路由的推荐方式是什么
- Windows8应用程序(html&Javascript):从图片库(除了文件选择器)显示图像的另一种方式
- angular 1.5应用程序中的导航栏
- 在mvc应用程序中,在回发时保留最初隐藏的文本框的隐藏或可见状态
- 如何使网络应用程序保留信息
- 关闭并重新访问应用程序后,本地存储中的数据不会保留
- Phonegap应用程序数据库版本在更新后保留
- 错误'路径保留冲突'同时启动流星应用程序
- 我应该在 JavaScript 应用程序中保留控制台语句吗?
- Titanium应用程序保留多次搜索的子视图
- 我的代码是否有任何错误,不允许在关闭应用程序后在移动浏览器上保留cookie
- 将XPages应用程序从Domino 8.5.3迁移到Domino 9.0—保留Dojo 1.6.1
- 移动应用程序的表视图中附加的行必须永久保留(钛)
- 如何在页面加载之间保留nodejs聊天应用程序小部件
- 在基于rest的web应用程序中保留继承的概念
- cordova navigator.app.close()将应用程序保留在后台
- 当链接被点击和javascript操纵DOM时,保留Spotify应用程序中的浏览器历史