在 MeanJS 应用程序中添加侧边栏

Add sidebar in MeanJS application

我有一个正在使用 MeanJS 开发的应用程序,它有一个 header、边栏和实际内容。使用来自 Meanjs 的模板,我们有 header 和内容 (data-view)。 因此,当我们在应用程序中加载 url 时,加载的内容使侧边栏和内容 window 重新加载。我可以让 header 和侧边栏始终固定,内容为 data-view 吗? 在 MeanJS 中如何修复添加边栏以及 header.

对此有任何想法。请帮助(如果需要我会详细解释。)

是的,你可以。您所要做的就是像这样在 layout.server.view.html 文件中添加侧边栏元素;

<header data-ng-include="'/modules/core/views/header.client.view.html'" class="navbar navbar-fixed-top navbar-inverse"></header>

<aside class="sidebar">
    <!-- Load your partial views here -->
    <section data-ng-include="'/modules/your-custom-module/views/view-your-custom-module.client.view.html'"></section>
    <section data-ng-include="'/modules/another-custom-module/views/view-another-custom-module.client.view.html'"></section>
    <!-- ... -->
</aside>

<section class="content">
  <section class="container">
    {% block content %}{% endblock %}
  </section>
</section>

现在侧边栏作为一个元素将保持不变,而其内容将根据您加载的范围数据动态更新。