[英]ngInclude directive in template twig symfony 2 not working
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. 我买了一个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 %}
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 包括模板layout.html.twig在内的布局位于我的同组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 navigation.html模板位于我的Bunilde 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. 感谢您的帮助。
Angular (on client side) can't access/find any files that are outside your web directory. Angular(在客户端)无法访问/查找您的Web目录之外的任何文件。
So I think you have to move/copy/asset-install them to /web/. 因此,我认为您必须将它们移动/复制/资产安装到/ web /。
AFAIK the syntax for the ngInclude
directive is AFAIK ngInclude
指令的语法是
<div ng-include src="path_to_your_html"></div>
or 要么
<ng-include src="path_to_your_html"></ng-include>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.