Javascript Symfony2-带AngularJS的束
我正在做一个项目,它主要基于Symfony2和Twig模板。我现在确实想基于AngularJS编写一个新的包。也就是说,大多数站点的菜单和导航仍然使用php/Twig,但是用户列表应该使用AngularJS编写。 我已启动AngularJS前端,并使用如下文件结构运行:Javascript Symfony2-带AngularJS的束,javascript,php,angularjs,symfony,Javascript,Php,Angularjs,Symfony,我正在做一个项目,它主要基于Symfony2和Twig模板。我现在确实想基于AngularJS编写一个新的包。也就是说,大多数站点的菜单和导航仍然使用php/Twig,但是用户列表应该使用AngularJS编写。 我已启动AngularJS前端,并使用如下文件结构运行: 应用程序/ js/ app.js 分部/ users.html user_detail.html index.html 鲍尔元件/ 现在,我只想在Symfony2中的给定路径下显示它。 有没有一种方法可以说,我
- 应用程序/
- js/
- app.js
- 分部/
- users.html
- user_detail.html
- index.html
- js/
- 鲍尔元件/
谢谢你的提示 我以前使用过
asoc/assetic angular js bundle
(),当与assetic过滤器配置一起使用时,这意味着所有的部分和脚本都被合并到一个文件中
他们的github页面说在你的小树枝模板中使用以下内容
{% javascripts filter="angular"
'@BundleName/Resources/views/aTemplate.html.ng'
'@BundleName/Resources/views/fooTemplate.html.ng'
'@BundleName/Resources/views/moarTemplates/*.html.ng'
%}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
然后,您可以在twig javascripts部分调用您的partials,如下所示
{% javascripts
'@BundleName/Resources/views/angular-app.js'
'@BundleName/Resources/views/angular-controllers.js'
'@BundleName/Resources/views/some-other-stuff.js'
'@BundleName/Resources/views/aTemplate.html.ng'
'@BundleName/Resources/views/fooTemplate.html.ng'
'@BundleName/Resources/views/moarTemplates/*.html.ng'
%}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
{%javascripts
“@BundleName/Resources/views/angular app.js”
“@BundleName/Resources/views/angular controllers.js”
“@BundleName/Resources/views/some other stuff.js”
“@BundleName/Resources/views/aTemplate.html.ng”
“@BundleName/Resources/views/fooTemplate.html.ng”
“@BundleName/Resources/views/moarTemplates/*.html.ng”
%}
{%endjavascripts%}
然后,我想您可以将上面的内容包含在希望它显示的一个细枝视图中,也可以将其包含在所有模板中(取决于您希望如何处理脚本缓存和其他内容),然后使用常规的ng视图UserListController
类型标记调用它
抱歉,如果这与您的问题无关。在我开始写这篇文章时,它非常有意义,但我对它的观察如此之多,似乎我刚刚偏离了正轨。我以前使用过asoc/assetic angular js bundle
(),当与assetic filter配置一起使用时,这意味着所有的部分和脚本都被合并到一个文件中
他们的github页面说在你的小树枝模板中使用以下内容
{% javascripts filter="angular"
'@BundleName/Resources/views/aTemplate.html.ng'
'@BundleName/Resources/views/fooTemplate.html.ng'
'@BundleName/Resources/views/moarTemplates/*.html.ng'
%}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
然后,您可以在twig javascripts部分调用您的partials,如下所示
{% javascripts
'@BundleName/Resources/views/angular-app.js'
'@BundleName/Resources/views/angular-controllers.js'
'@BundleName/Resources/views/some-other-stuff.js'
'@BundleName/Resources/views/aTemplate.html.ng'
'@BundleName/Resources/views/fooTemplate.html.ng'
'@BundleName/Resources/views/moarTemplates/*.html.ng'
%}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
{%javascripts
“@BundleName/Resources/views/angular app.js”
“@BundleName/Resources/views/angular controllers.js”
“@BundleName/Resources/views/some other stuff.js”
“@BundleName/Resources/views/aTemplate.html.ng”
“@BundleName/Resources/views/fooTemplate.html.ng”
“@BundleName/Resources/views/moarTemplates/*.html.ng”
%}
{%endjavascripts%}
然后,我想您可以将上面的内容包含在希望它显示的一个细枝视图中,也可以将其包含在所有模板中(取决于您希望如何处理脚本缓存和其他内容),然后使用常规的ng视图UserListController
类型标记调用它
抱歉,如果这与您的问题无关。在我开始写这篇文章时,它非常有意义,但我对它的观察如此之多,似乎我刚刚偏离了正轨。我以前使用过asoc/assetic angular js bundle
(),当与assetic filter配置一起使用时,这意味着所有的部分和脚本都被合并到一个文件中
他们的github页面说在你的小树枝模板中使用以下内容
{% javascripts filter="angular"
'@BundleName/Resources/views/aTemplate.html.ng'
'@BundleName/Resources/views/fooTemplate.html.ng'
'@BundleName/Resources/views/moarTemplates/*.html.ng'
%}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
然后,您可以在twig javascripts部分调用您的partials,如下所示
{% javascripts
'@BundleName/Resources/views/angular-app.js'
'@BundleName/Resources/views/angular-controllers.js'
'@BundleName/Resources/views/some-other-stuff.js'
'@BundleName/Resources/views/aTemplate.html.ng'
'@BundleName/Resources/views/fooTemplate.html.ng'
'@BundleName/Resources/views/moarTemplates/*.html.ng'
%}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
{%javascripts
“@BundleName/Resources/views/angular app.js”
“@BundleName/Resources/views/angular controllers.js”
“@BundleName/Resources/views/some other stuff.js”
“@BundleName/Resources/views/aTemplate.html.ng”
“@BundleName/Resources/views/fooTemplate.html.ng”
“@BundleName/Resources/views/moarTemplates/*.html.ng”
%}
{%endjavascripts%}
然后,我想您可以将上面的内容包含在希望它显示的一个细枝视图中,也可以将其包含在所有模板中(取决于您希望如何处理脚本缓存和其他内容),然后使用常规的ng视图UserListController
类型标记调用它
抱歉,如果这与您的问题无关。在我开始写这篇文章时,它非常有意义,但我对它的观察如此之多,似乎我刚刚偏离了正轨。我以前使用过asoc/assetic angular js bundle
(),当与assetic filter配置一起使用时,这意味着所有的部分和脚本都被合并到一个文件中
他们的github页面说在你的小树枝模板中使用以下内容
{% javascripts filter="angular"
'@BundleName/Resources/views/aTemplate.html.ng'
'@BundleName/Resources/views/fooTemplate.html.ng'
'@BundleName/Resources/views/moarTemplates/*.html.ng'
%}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
然后,您可以在twig javascripts部分调用您的partials,如下所示
{% javascripts
'@BundleName/Resources/views/angular-app.js'
'@BundleName/Resources/views/angular-controllers.js'
'@BundleName/Resources/views/some-other-stuff.js'
'@BundleName/Resources/views/aTemplate.html.ng'
'@BundleName/Resources/views/fooTemplate.html.ng'
'@BundleName/Resources/views/moarTemplates/*.html.ng'
%}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
{%javascripts
“@BundleName/Resources/views/angular app.js”
“@BundleName/Resources/views/angular controllers.js”
“@BundleName/Resources/views/some other stuff.js”
“@BundleName/Resources/views/aTemplate.html.ng”
“@BundleName/Resources/views/fooTemplate.html.ng”
“@BundleName/Resources/views/moarTemplates/*.html.ng”
%}
{%endjavascripts%}
然后,我想您可以将上面的内容包含在希望它显示的一个细枝视图中,也可以将其包含在所有模板中(取决于您希望如何处理脚本缓存和其他内容),然后使用常规的ng视图UserListController
类型标记调用它
抱歉,如果这与您的问题无关。在我写这篇文章的开始,它让我