gpt4 book ai didi

javascript - MEAN.IO 如何更改默认模板?

转载 作者:行者123 更新时间:2023-11-30 17:19:44 25 4
gpt4 key购买 nike

我发现很难弄清楚 MEAN.IO 堆栈如何定义在整个模块和/或包中使用的 default.html 模板。我正在尝试将一个 View 更改为使用 default.html 模板,以使用我定义的 View 。

他们的文档 http://mean.io/#!/docs说他们使用“痛饮”作为他们的模板系统。但是,我进行了文件搜索并在模板中找到了 5 个“swig”,并且它仅在 html 中声明为文本。我没有看到在哪里使用了 swig,也没有在后端注入(inject)。它应该在后端。有任何想法吗? .

默认是我所有其他页面用作其父页面的 html 模板。我想将该 html 更改为另一个。下面是 default.html 的样子:

<!doctype html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="https://www.facebook.com/2008/fbml" itemscope="itemscope" itemtype="http://schema.org/Product">
{% include '../includes/head.html' %}

<body>
<div class="navbar navbar-default navbar-fixed-top" data-ng-include="'/system/views/header.html'" data-role="navigation"></div>
{% if adminEnabled %}
<section class="admin-menu">
<div data-ng-include="'/mean-admin/views/index.html'"></div>
</section>
{% endif %}
<section class="content">
<section class="container">
{% block content %}{% endblock %}
</section>
</section>
{% include '../includes/foot.html' %}
</body>

</html>

最佳答案

万一其他人在这里找到了希望得到答案的方式:文档可以在这里找到: http://learn.mean.io/#mean-stack-packages-overriding-the-default-layouts

来自文档:

One is able to override the default layout of the application through a custom package. Below is an example overriding the default layout of system and instead using the layouts found locally within the package

MyPackage.register(function(system, app) {
app.set('views', __dirname + '/server/views');
// ...

Please note that the package must depend on System to ensure it is evaluated after System and can thus override the views folder

关于javascript - MEAN.IO 如何更改默认模板?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25355624/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com