- Building Single:page Web Apps with Meteor
- Fabian Vogelsteller
- 139字
- 2021-08-06 19:29:37
Adding templates and partials
To show the home template in the app, we need to open index.html
, which we created earlier, and perform the following steps:
- We replace
Hello World
with the following template inclusion helper:{{> layout}}
- If we go back to our browser now, we see that the text is gone and the
layout
template, which we created earlier, has appeared with its header and menu. - To complete the page, we need to show the
home
template in thelayout
template. We do this by simply adding another template inclusion helper to themain
section of thelayout
template in ourlayout.html
file, as follows:<main> {{> home}} </main>
- If we go back to the browser, we should see the following screenshot:
If we would now switch {{> home}}
for {{> about}}
, we would see our about
template instead.
推薦閱讀
- JavaScript全程指南
- 圖解Java數(shù)據(jù)結構與算法(微課視頻版)
- Scratch真好玩:教小孩學編程
- C語言從入門到精通(第4版)
- Python貝葉斯分析(第2版)
- C語言程序設計案例精粹
- 深入淺出RxJS
- 零基礎學單片機C語言程序設計
- Extending Puppet(Second Edition)
- Spring Security Essentials
- Getting Started with Python and Raspberry Pi
- PHP與MySQL權威指南
- 大學計算機應用基礎(Windows 7+Office 2010)(IC3)
- 高效使用Greenplum:入門、進階與數(shù)據(jù)中臺
- Deep Learning for Natural Language Processing