【问题标题】:handlebars "include" "partial" ember CLI车把“包括”“部分”ember CLI
【发布时间】:2015-02-01 02:18:54
【问题描述】:

我想在一个 ember 项目中抽象出 html 片段。

例如...将<head> 保存在不同的文件中,并将其“包含”在index.hbs 或其他内容中。 (想想php<?php include('something'); ?>

到目前为止,ember CLI 和车把中的命名约定有点陌生 - 我没有找到我认为非常标准的东西...

我的猜测是 `{{#include 'head.hbs'}}' 之类的

对此必须有一个约定...但我认为我使用了错误的搜索词。

谢谢。

【问题讨论】:

标签: ember.js handlebars.js ember-cli


【解决方案1】:

您可以使用{{render 'your-template-file'}}{{partial 'your-partial-file'}} 来完成此操作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-01-14
    • 1970-01-01
    • 2013-01-25
    • 1970-01-01
    • 2017-09-14
    • 1970-01-01
    • 2016-03-24
    相关资源
    最近更新 更多