模板twig symfony 2中的ngInclude指令不起作用(ngInclude directive in template twig symfony 2 not working)

编程入门 行业动态 更新时间:2024-10-27 18:29:47
模板twig symfony 2中的ngInclude指令不起作用(ngInclude directive in template twig symfony 2 not working)

我买了一个html / angular js模板,我尝试将它集成到symfony 2.指令ng-include似乎不起作用。

{# src/Neobe/AccueilBundle/Resources/views/layout.html.twig #} {% extends '::base.html.twig' %} {% block title %} Welcome {% endblock %} {% block body %} <!-- Wrapper--> <div id="wrapper"> <!-- Navigation --> <div ng-include="'views/common/navigation.html'"></div> <!-- Page wraper --> <!-- ng-class with current state name give you the ability to extended customization urview --> <div id="page-wrapper" class="gray-bg {[{$state.current.name}]}"> <!-- Page wrapper --> <div ng-include="'views/common/topnavbar.html'"></div> <!-- Main view --> <div ui-view></div> <!-- Footer --> <div ng-include="'views/common/footer.html'"></div> </div> </div> <!-- End page wrapper--> {% endblock %}

包含模板layout.html.twig的布局位于我的bunlde Accueil的公共文件夹中:AccueilBundle / Resources / views / Accueil / layout.html.twig

navigation.html模板位于我的bunlde Accueil的公共文件夹中:AccueilBundle / Resources / views / Accueil / views / common / navigation.html

你能告诉我什么是错的吗?

我在浏览器中没有错误,但没有包含任何内容。

谢谢你的帮助。

I bought an html/angular js template and i try to integrated it in symfony 2. The directive ng-include seems to be not working.

{# src/Neobe/AccueilBundle/Resources/views/layout.html.twig #} {% extends '::base.html.twig' %} {% block title %} Welcome {% endblock %} {% block body %} <!-- Wrapper--> <div id="wrapper"> <!-- Navigation --> <div ng-include="'views/common/navigation.html'"></div> <!-- Page wraper --> <!-- ng-class with current state name give you the ability to extended customization urview --> <div id="page-wrapper" class="gray-bg {[{$state.current.name}]}"> <!-- Page wrapper --> <div ng-include="'views/common/topnavbar.html'"></div> <!-- Main view --> <div ui-view></div> <!-- Footer --> <div ng-include="'views/common/footer.html'"></div> </div> </div> <!-- End page wrapper--> {% endblock %}

The layout which is included templates, layout.html.twig , is located in my public folder of my bunlde Accueil : AccueilBundle/Resources/views/Accueil/layout.html.twig

The navigation.html template is located in my public folder of my bunlde Accueil : AccueilBundle/Resources/views/Accueil/views/common/navigation.html

Can you tell me what's wrong ?

i have no error in the browser but nothing is included.

Thank u for your help.

最满意答案

AFAIK是ngInclude指令的语法

<div ng-include src="path_to_your_html"></div>

要么

<ng-include src="path_to_your_html"></ng-include>

AFAIK the syntax for the ngInclude directive is

<div ng-include src="path_to_your_html"></div>

or

<ng-include src="path_to_your_html"></ng-include>

更多推荐

本文发布于:2023-08-07 09:26:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1463337.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:指令   不起作用   模板   symfony   twig

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!